Laziale
Laziale

Reputation: 8225

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

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?

Upvotes: 3

Views: 4977

Answers (1)

Corey Adler
Corey Adler

Reputation: 16149

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.

Upvotes: 4

Related Questions