Reputation: 4265
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 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?
Upvotes: 0
Views: 345
Reputation: 364259
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.
Upvotes: 1