Are there Database Initializers in Entity Framework Core?

entity-framework entity-framework-core

Question

I can't find examples on how to use EF Database Initializers with EF Core nor can I find a list of EF Database Initializers shipping with EF Core.

Has the concept of Database Initializers become obsolete? What's the current approach of initializing a database ... or not initializing an existing database?

1
9
11/2/2017 1:29:01 AM

Popular Answer

In .Net core you can use functions of Database property form DbContext instance. It allows you to create database (EnsureCreated), destroy database (EnsureDeleted) and migrate to last migration (Migrate). Required data should be placed in migrations. Look at last section of https://docs.microsoft.com/ef/core/managing-schemas/migrations/ for more details.

1
5/16/2019 4:49:59 PM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow