EF5 Code First: Detect if it creates a database so I can run ALTER statements

后端 未结 2 1920
醉话见心
醉话见心 2021-01-29 01:12

I am new with Entity Framework 5. Our team is using Code First workflow.

Before I\'ll start with my main question, let me first show you what I have tr

2条回答
  •  梦毁少年i
    2021-01-29 01:26

    If you don't use (or cannot use) EF migrations you can use custom initializer as mentioned in this answer. The custom initializer will execute a Seed method after creating the database = only once when database doesn't exist. If you need to incrementally develop the database initializer itself will not help you (that is what migrations are for).

提交回复
热议问题