开发者

Database initalizer and seeding data from an SQL script?

I have a few tables that are created by entity framework that house my region and country data. I have a couple SQL scripts that I run after the开发者_StackOverflow中文版 model is updated, but it is becoming annoying to keep doing that. I would like to automate this a bit. Would I load my script into the Database.ExecuteSqlCommand() method of the context or is there a better way of dealing with this?


No if you want automatic way there is no better approach then implementing derived initializer and use override Seed method which will load your scripts and execute them. That is why Seed method exists.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜