Permalink
Branch: master
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
40 lines (28 sloc) 1.64 KB

Using Migrations

(It is only applicable for the ExtCore framework version 3.1.0-beta1 and higher.)

Migrations feature is only available if you are using Entity Framework Core as the ORM. To make it possible to use the Migrations tool, please, follow these steps:

1. Create the DesignTimeStorageContextFactory class (you can use any name) and inherit it from the ExtCore.Data.EntityFramework.DesignTimeStorageContextFactoryBase<T> one (here T is the type of the storage context you are using). You don’t need to implement any methods in this class:

2. Initialize the StorageContextOptions.MigrationsAssembly property with the name of the assembly (project) where the DesignTimeStorageContextFactory class is created:

  1. Call the DesignTimeStorageContextFactory.Initialize() static method after the StorageContextOptions class configuration:

That’s all, now you can use the Migrations tool.