abp icon indicating copy to clipboard operation
abp copied to clipboard

IdentityUser adds navigation properties

Open 1957993455 opened this issue 10 months ago • 1 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Description

现在我想在IdentityUser中添加一个集合public ICollection<Post> Posts { get; set; } ,但是好像不能继承IdentityUser这个类,所有我用abp框架的对象拓展功能来实现一个用户对应多个post的关系,我不知道如何实现,我搜索了,但是好像都不太正确,或者说文章和用户不用配置这个关系,能给我一个解决方案吗?我不太了解这个框架

Reproduction Steps

No response

Expected behavior

No response

Actual behavior

No response

Regression?

No response

Known Workarounds

No response

Version

8.1

User Interface

MVC

Database Provider

EF Core (Default)

Tiered or separate authentication server

None (Default)

Operation System

Windows (Default)

Other information

现在我想在IdentityUser中添加一个集合public ICollection<Post> Posts { get; set; } ,但是好像不能继承IdentityUser这个类,所有我用abp框架的对象拓展功能来实现一个用户对应多个post的关系,我不知道如何实现,我搜索了,但是好像都不太正确,或者说文章和用户不用配置这个关系,能给我一个解决方案吗?我不太了解这个框架

1957993455 avatar Apr 20 '24 14:04 1957993455

This is not a bug, and you can configure one to many relationships between Posts and IdentityUser entities https://learn.microsoft.com/en-us/ef/core/modeling/relationships/one-to-many

realLiangshiwei avatar Apr 21 '24 01:04 realLiangshiwei