Skip to content

Latest commit

 

History

History
15 lines (10 loc) · 905 Bytes

File metadata and controls

15 lines (10 loc) · 905 Bytes

Entity Framework Core Code First Migration using Separate Assembly

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.

  1. DataModels has Product and Category models.
  2. Migrations/initial/ contents EF Core migration script.
  3. StoreContext.cs ApplicationContext of DBContext

EF Core First Migration

For step by step implementation click here