ContextModelSnapshot and Manual Migrations in EF7

entity-framework-core

Question

With Entity Framework 7 I created the first migration and got two files:

20151206224643_InitialDatabaseSetup.cs
ContextModelSnapshot.cs
  1. What is ContextModelSnapshot for?

  2. What if I need to change a migration code? For example, using SQL code to create a procedure or add filestream?

  3. Can, or should I, add empty migrations and setup the code manually?

Popular Answer

What is ContextModelSnapshot for?

Unlike EF 6, in EF Core there is no more snapshots per migrations stored in database. Instead, there is one snapshot per context.

Find out more at http://mehrandvd.me/2016/02/18/entity-framework-core-migrations

Not sure about your 2nd and 3rd questions.



Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Is this KB legal? Yes, learn why
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Is this KB legal? Yes, learn why