Are there Database Initializers in Entity Framework Core?

前端 未结 1 750
-上瘾入骨i
-上瘾入骨i 2021-02-19 15:41

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 Da

1条回答
  •  时光说笑
    2021-02-19 16:30

    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.

    0 讨论(0)
提交回复
热议问题