0

By using "Code First" model programming is possible to create migrations do update database schema. Is possible to create migrations to update database schema using ASP.Net Entity Framework and "DB First"? Is possible to somehow update database schema (without data loss)?

1
  • I don't really know how this would work. DB first means: EF creates POCO classes from database schema. Code first means: EF maps Db schema according to given POCO classes. So the migration would basically create POCO classes and migrate this to another schema you somewhere saved? How would the new context be accessed? I don't really know how this would work. To your update question: You can use null initializer and update your schema with SQL queries, however I'm not sure if you can use EF the same way you used to after this. Commented Jun 28, 2016 at 20:16

1 Answer 1

1

You can do "Code First from an existing database" if that's what you mean. Here's a walkthrough.

This will create models for you in C# based on the existing database design, it's basically a one-time setup. From there you can use it as if you were Code First all along.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.