Recently I needed a quick and low friction way of extending Asp.Net Identity 2.0, tying into the Entity Framework 6 way of working with custom fields and table mappings. To accomplish this first create something similar to a new ContosoIdentityUser which inherits from IdentityUser.
ContosoIdentityUser.cs
1 | using Microsoft.AspNet.Identity.EntityFramework; |
We then likewise create a new ContosoIdentityDbContext which inherits from IdentityDbContext.
ContosoIdentityDbContext.cs
1 | using System; |
Now to stitch it all together in your boot strapper logic, in my case this is within Startup(), just wire up to our newly created extensions:
1 | var userManager = new UserManager(new UserStore(new ContosoIdentityDbContext())); |