What is the difference between IdentityDbContext and IdentityDbContext in MVC5

asp.net asp.net-mvc asp.net-mvc-5 entity-framework entity-framework-6

Question

On what basis should one decide to use IdentityDbContext versus IdentityDbContext<ApplicationUser> in an ASP.NET MVC5 application?

What benefits do we get by using IdentityDbContext<ApplicationUser> instead of the non-generic IdentityDbContext?

1
9
11/29/2013 8:42:13 AM

Accepted Answer

IdentityDbContext<ApplicationUser> will let you use your own ApplicationUser class as the User entity. I.e. you can have custom properties on your users. The IdentityDbContext class inherits from IdentityDbContext<IdentityUser> which means you will have to use the IdentityUser class for your users.

If you want to have more properties on your user objects than the few properties that IdentityUser provide (UserName, PasswordHash and a few more) then you may want to choose IdentityDbContext<ApplicationUser>

12
11/29/2013 10:21:31 AM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow