Friday, May 6, 2011

Simplify the understanding and maintenance of your domain model by Entity Framework Code First

Code First is a new development approach in the Entity Framework stack that can simplify the understanding and maintenance of your domain model.

n the Database First approach, you started with an existing database and used the Entity Framework wizard to create the Entity Data Model (EDM). The model was built as a one-to-one mapping between the database and the conceptual model, and after it was created you could customize it to make it more like the domain requirements.

On the other hand, the Model First approach was limited in the first version. When Visual Studio 2010 and the Microsoft .NET Framework 4 were shipped, the Model First implementation was improved significantly. In Model First, you could start working with an empty model and create your desired conceptual model. After the creation of the model, you could use the Generate Database Script from Model feature, which wasn't part of the Entity Framework 1 designer, to create the EDM storage and mapping schemas and also to generate a Data Definition Language (DDL) script. The generated DDL script could be used to create a database that would fit to the model according to a Model First workflow.

Not Just a Designer: Code First in Entity Framework
http://visualstudiomagazine.com/Articles/2011/05/01/pfint_EF-Code-First.aspx?Page=1

Controller template, explained by ScottGu for the ASP.NET MVC 3 Tools Update

Controller template, explained by ScottGu for the ASP.NET MVC 3 Tools Update

http://weblogs.asp.net/scottgu/archive/2011/05/05/ef-code-first-and-data-scaffolding-with-the-asp-net-mvc-3-tools-update.aspx