Last post May 15, 2017 06:09 AM by Cathy Zou
May 12, 2017 04:03 AM|gimmesomesupport|LINK
I have used ASP.NET Identity in my code-first projects before and tried using it in a project that has an existing database-first approach in MySQL.
I have gone through almost everything I could find on the internet to make this work, but failed with errors like missing key or changed entity at runtime. I must be missing something here.
I would be really grateful if anyone gave me a comprehensive guide to implementing databse-first with ASP.Net identity. Thanks!
May 15, 2017 06:09 AM|Cathy Zou|LINK
To start using ASP.NET Identity I advice the following steps:
1.Generate a code model from your existing database
2.On the tables you'd like to use for your Identity implementation inherit from the appropriate classes
3.Create a migration and apply the changes to your database.
To enable identity with the files you generated from your database:
1.Inherit the generated context from IdentityDbContext instead of DbContext.
2.Inherit youre user model from IdentityUser