auto update code first from database model, is it possible?

code-first ef-code-first entity-framework entity-framework-5 entity-framework-6

Question

I have code first classes which are generated from my existing db using ADO.NET Entity Data Model. Now I've added some new tables to the database.

I want to know if its possible to create associated code classes from the new db tables without (re)creating the model again from scratch?

1
3
11/13/2014 8:00:46 PM

Accepted Answer

Yes it is, if you use Reverse Engineer Code First to do so. It will create POCOs exactly like Code-First, but it will do so based completely on the current database. No .edmx file and no T4 template. Just Code-First.

You should know, by the way, that this (along with regular Code-First) are going to be the only ones allowed in EF7. They are getting rid of many things to try to slim it down, and both Model- and Database-First got the ax (at least, for now). This blog post from Microsoft's ADO.NET blog explains that, along with some other features.

4
11/13/2014 7:57:16 PM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow