Entity Framework code first, isn't creating the database

后端 未结 2 690
旧时难觅i
旧时难觅i 2020-12-10 03:51

Here\'s an overview of how my solution looks:

\"enter

Here\'s my PizzaSoftware

2条回答
  •  旧巷少年郎
    2020-12-10 04:23

    Initializer is executed when you need to access the database. If you want to create database on application start either use:

    context.Database.Initialize(true);
    

    Or don't use initializer and call:

    context.Database.CreateIfNotExists();
    

提交回复
热议问题