I'm building an application that will be exposed to the public. So the database will be filled with data. I'm not sure how to extend the model afterwards. Locally after any changes of the model the database get's recreated. How can add properties to the existing model, without recreate the entire database ?
1 Answer
Take a look at EntityFramework CodeFirst Migration, for modifying your schema.
2 Comments
MR.ABC
I'm not sure. Maybe there is a better solution. Waiting. If not accept.
Joshua Shearer
I'm not sure how OP intends to maintain his data in an RDBMS if he keeps changing the definition of his data. Migrations are pretty much the only way to go. OP and NoSQL sound like a match made in heaven.
modelsare what I'm referring to asentities. You'll need to abstract it down another layer if you plan on making changes without causing entity framework to recreate your database every time. Though, it sounds like you're a bit new to databases in general. It might be worthwhile to read up on them before moving forward.ToStringto the generated classes (in database first)ToStringmethod should't cause the database to be recreated; the schema wouldn't have changed as a result of that addition.