Search code examples
sqlentity-frameworkentity-framework-5ef-database-firstdatabase-first

Is it possible to alter database using EntityFramework- Database First workflow


is it possible to change database tables (e.g adding a field in a particular table) in an application using Entity framework.??

My application used an existing database to generate a model nd entity classes out of that database, if now I want to change tables in my existing database , how can I do that using Entity framework, so that:

  1. Changes are saved in previously generated Entity classes
  2. Changes are saved in database also.

Solution

  • Well you'll either have to change the database or the model classes.. If you don't want to update both manually, you could just update the database DDL and then generate the Entity model again.