Code-First Development with Entity Framework 4
page 1 of 21
Published: 16 Jul 2010
Unedited - Community Contributed
Abstract
In this article, Scott examines the functionality of code first development with Entity Framework 4. After a short introduction regarding the latest features in Entity Framework 4, he delves deep into the development of a real world code first application with the help of a step-by-step tutorial with relevant source code and screenshots. Towards the end of the article, Scott also shows how to run the application along with the complete source code for the sample application.
by Scott Guthrie
Feedback
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 65356/ 181

Introduction

Republished with Permission - Original Article

.NET 4 ships with a much improved version of Entity Framework (EF) – a data access library that lives in the System.Data.Entity namespace.

When Entity Framework was first introduced with .NET 3.5 SP1, developers provided a lot of feedback on things they thought were incomplete with that first release.  The SQL team did a good job of listening to this feedback, and really focused the EF that ships with .NET 4 on addressing it. 

Some of the big improvements in EF4 include:

POCO Support: You can now define entities without requiring base classes or data persistence attributes.

Lazy Loading Support: You can now load sub-objects of a model on demand instead of loading them up front.

N-Tier Support and Self-Tracking Entities: Handle scenarios where entities flow across tiers or stateless web calls.

Better SQL Generation and SPROC support: EF4 executes better SQL, and includes better integration with SPROCs

Automatic Pluralization Support: EF4 includes automatic pluralization support of tables (e.g. Categories->Category).

Improved Testability: EF4’s object context can now be more easily faked using interfaces.

Improved LINQ Operator Support: EF4 now offers full support for LINQ operators.

Visual Studio 2010 also includes much richer EF designer and tooling support. The EF designer in VS 2010 supports both a “database first” development style – where you construct your model layer on a design surface from an existing database.  It also supports a “model first” development style – where you first define your model layer using the design surface, and can then use it to generate database schema from it.


View Entire Article

User Comments

No comments posted yet.

Product Spotlight
Product Spotlight 





Community Advice: ASP | SQL | XML | Regular Expressions | Windows


©Copyright 1998-2024 ASPAlliance.com  |  Page Processed at 2024-10-15 5:07:40 AM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search