Computer
Computer

Reputation: 2227

How to move Identity classes into Models and update database

I create a Class Library project and add all my models into this library (Code First from database). Install Entity Framework 6.4 too. I ran the wizard to create these model classes as the Database already exists.

I create another class library which contains the DbContext file along with my Repositories.

I now add a new standard MVC project (inside this solution) with Authentication selected which creates the Identity classes.

What is the process to move all Identity classes into my models and generate the tables for an existing database?

Upvotes: 0

Views: 123

Answers (1)

Rodrigo Chapeta
Rodrigo Chapeta

Reputation: 119

  1. First add to your User model the identity fields.
  2. Create a new migration
  3. Run the application and let it.

public class ApplicationUser : IdentityUser

Upvotes: 1

Related Questions