1
votes

I saw a lot toturial about asp.net Identity 2.0 with esixting database, but they still use the same table name(AspNetUsers) and column name, and some of column I don't wanna use, so I just want to implement IUser, I don't need to inherit the IdentityUser, and I just need 3 table (User, Roles, UserRole).

how do I use the asp.net Identity 2.0 with the old customized database

1

1 Answers

1
votes

It's certainly possible. There are basically two options if you are using Entity Framework for your existing database.

  1. Provide your own mapping to the built in classes, by using your own OnModelCreating override on the DB Context.
  2. Provide an own storage for ASP.NET Identity by implementing IUserStore, IRoleStore and IUserRoleStore in one storage class. This way you can map to existing classes in your data model.

If you are using another DB access than EF Code First you have to use option 2