This blogpost explains how to achieve Entity Framework code first migrations having Models, DBContext, and Model Snapshot files in assembly different than web or startup projects.
By following this tutorial you will create a Class library project, data models with DataAnnotations validation, A pplicationContext class implementing DBContext, and implement IDesignTimeDbContextFactory to avoid the use of startup class.
- DataModels has Product and Category models.
- Migrations/initial/ contents EF Core migration script.
- StoreContext.cs ApplicationContext of DBContext
For step by step implementation click here