admin管理员组文章数量:1186701
I'm writing a simple app to manage the relationship between some entities:
- An application administrator
- The business admin (running a film-making company)
- The director of the film
There are other entities like film, agreement (between company and director) etc. as well, but I'm not going to name them one by one.
Because my question goes like this:
following an agreement, the business admin (or app admin) creates a director instance who might not have yet registered himself/herself in the app through ASP.NET Core Identity. So they're not yet an Identity User. As the application mainly serves the film-making company, not the directors, it's essential for the film-making company to be able to have a track of all agreements, directors, movies and so on.
The Identity Users, Roles etc. are saved in the database through ApplicationDbContext
.
Other business domain entities like the director, the film etc. are saved in another database through DomainDbContext
.
How may I handle the logic I explained above? I mean how to relate the director to Identity User when they register through ASP.NET Core Identity in the application?
I'm sort of a beginner, so please explain if my logic is right in the first place and if so, help me out for implementing it.
Thanks in advance!
I just have thought about relating a field like Email between Directors and Identity Users and based on that, decide whether a director is an ApplicationUser
instance or not. I tried to register a service to handle this logic, but I think it's not the thing that I want. Also after I added the
public ApplicationUser User { get; set; }
to my director model and tried to make a migration, I realized that the migration is making a whole new table for Identity Users in the DomainDbContext
which is obviously not what should it look like.
I know there are other questions related to stuff I mentioned here, but I was not able to find the answer I was looking for. I forgot to mention I'm using code-first workflow and I'm totally confused
本文标签: cHow to make use of Identity User in a model of another DbContext (ASPNET Core)Stack Overflow
版权声明:本文标题:c# - How to make use of Identity User in a model of another DbContext (ASP.NET Core)? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1738354098a2079517.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论