ASP.NET Identity 2.0 on existing DB-model PART 2
Why Stack Overflow recommends it
Stack Overflow users link it when answering questions about using ASP.NET Identity 2.0 with an existing database, custom user tables or a custom user manager.
Recommended by 1 people across 1 different months, 2014 to 2017.
What it is
A 24-minute screencast from the codingfreaks channel that follows an earlier video on wiring ASP.NET Identity 2.0 to an existing database model. It uses the final version of the code and walks through common trouble spots, with the source code available for download.
What people said
Recommends DSR · 2014-09 · Stack Overflow · on “Extending IdentityUserRole in Identity 2.0”
Take a look at below video tutorial on using asp.net identity using existing database tables. I think you have to let ApplicationUser table know that you have new field in your ApplicationUserRole table. So that you have to follow entity framework model binding in order to achieve that. Part 1 - [LINK] Part 2 - [this video] You don't need to implement your own userManager, but you have to amend it. Hope you can use this example to support your needs.
Recommends DSR · 2014-09 · Stack Overflow · on “Merge MyDbContext to Asp.net IdentityDbContext”
If I got you correct, you are trying to use your existing database, tables and existing users with asp.net identity framework. First thing, according to my understanding, you can't merge your db context (MyDbContext) with 'IdentityDbContext', because context of asp.net identity framework tables has to be inherited from IdentityDbContext<YourUserTable> . But your other tables may inherited from DbContext . Therefore you have to use two separate db contexts if you want to use identity framework build in method support, which is UserManager etc. You can use your existing database with identity framework, you just need to correctly bind your database tables with identity framework EF code first
Recommends DSR · 2014-09 · Stack Overflow · on “Upgrading SQL authentication EF database first to Identity 2”
There is a YouTube video tutorial which may help you to get some idea in order to achieve your task. Actually this isn't for migrating membership to Identity 2.0, but this video illustrates to use Identity 2.0 with existing database. I hope you can work with your current resources (The given link). Part 1: [LINK] Part 2: [this video] Hope this helps.
Cites Lars · 2014-11 · Stack Overflow · on “Inherit from IdentityUser I get an error on UserManager<User>”
When you extend with your own User class you have to provide all of the types that Identity uses. Here is my context class, notice that i use string as key: public class EarlyDetectionContext : IdentityDbContext<User, Role, string, EDLogin, RoleUserAssociation, EDClaim> Of course you also need to make classes for role userlogin, userclaim and userroles. Here is mine: public class EDClaim : IdentityUserClaim<string> { } public class EDLogin : IdentityUserLogin<string> { } [Table("Roles", Schema = "ED")] public class Role : IdentityRole<string, RoleUserAssociation> { [Required, Column("DisplayName")] public string DisplayName { get; set; } [Required, Column("Created")] public DateTime Created
Cites Vasily Hall · 2017-08 · Stack Overflow · on “Using Asp.NET Identity with custom user manager/database”
I have found a video ( [this video] ) which shows making the system work with custom database, but it still relies on having tables made for all the Asp data tables for the claims, etc. Then, I found this page ( [LINK] ) which let me forget about the extra tables, etc and just use the cookie authentication, thanks to a search sparked by your link above.