简体   繁体   中英

EF6 add-migration fails

After writing my program, I wanted to change the structure of the project.

That means I have a common dll with interfaces and the designed models.

A controller dll and a view dll.

As you can see in the screenshot is my ApplicationDbContext in the controller dll.

Screenshot Solution Explorer Project Structure

I'm trying to make an add-migration and update-database but it does not seem to work the up and down methods are empty.

Configuration.cs

Migration init

Why is that? Where everything was in a dll, it worked.

Thank you for your efforts.

Try This it's Working.

-> Create Model Of EntityStateMedel.(if not create)
-> Models/ApplicationDbContext.cs 
    - Create DbsetFor Your Model.
    - ex : public DbSet<EntityState> EntityStateSet { get; set; }
-> Add-Migration -force "Name"
-> Update-Database -verbos

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM