EF6 database First check for database schema changes

739 Views Asked by At

I have a model.edmx file generated using ef6 database first approach. The database is used by a number of apps and I have no control over when or how the schema may change.

There is a GUI wizard to "update model from database" which works for my purpose. The wizard detects differences between my model and the database, so if I add a table directly to the database, or add/remove a column from some existing table I can see those changes in the "update model from database" wizard.

Is there a way to detect these changes programmatically? and is it possible to update the schema programmatically? or just regenerate it altogether to match the database?

At the least, is it possible to programmatically distinguish that the model is out of sync with the db, using existing EF libraries, rather than writing my own custom schema compare.

Thank you.

0

There are 0 best solutions below