Asp.net
MVC5 中的 IdentityDbContext 和 IdentityDbContext<ApplicationUser> 有什麼區別
應該在什麼基礎上決定在 ASP.NET MVC5 應用程序中使用
IdentityDbContext與使用?IdentityDbContext<ApplicationUser>
IdentityDbContext<ApplicationUser>通過使用而不是非泛型我們可以獲得什麼好處IdentityDbContext?
IdentityDbContext<ApplicationUser>將讓您使用自己的ApplicationUser類作為User實體。即您可以在您的使用者上擁有自定義屬性。該類IdentityDbContext繼承自IdentityDbContext<IdentityUser>這意味著您必須IdentityUser為您的使用者使用該類。如果您想在使用者對像上擁有比
IdentityUser提供的少數屬性(UserName、PasswordHash 等)更多的屬性,那麼您可能需要選擇IdentityDbContext<ApplicationUser>