简体   繁体   English

将ASP.net Identity用户与其他表一起使用

[英]Using ASP.net Identity user with other tables

I am just trying the new ASP.Net Identity, but run into some issues. 我只是尝试使用新的ASP.Net Identity,但是遇到了一些问题。

The first issue is that I found out that the ApplicationContext inherits IdentityDbContext rather than DbContext which I think has reasons. 第一个问题是我发现ApplicationContext继承了IdentityDbContext而不是我认为有原因的DbContext。

The second issue is that since I will be using a lot of tables apart from the standard table generated by the Identity, should all my DbSet be declared within the ApplicationContext that inherits IdentityDbContext? 第二个问题是,由于我将使用除Identity生成的标准表以外的许多表,是否应在继承IdentityDbContext的ApplicationContext中声明我的所有DbSet?

I'm not sure what your first issue is asking. 我不确定您的第一个问题在问什么。 But for your second, no, you aren't required to use the context for managing other tables in your database. 但是第二,不,您不需要使用上下文来管理数据库中的其他表。 I use the ADO.NET Entity Data Model for my application's tables typically, and only need to use the Identity Context for any Account/Role related controllers. 我通常将ADO.NET实体数据模型用于应用程序的表,并且只需要对任何与帐户/角色相关的控制器使用身份上下文。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM