EntityFramework

FacebookTwitter
Data annotation attributes were introduced in .NET 3.5 as a way to add validation to classes used by ASP.NET applications. Since that time , RIA Services has begun using data annotations and they are now part of Silverlight . Code First allows you to build an EDM Entity Framework model using code (C# or VB.NET) and is now in its third CTP .

Data Annotations in the Entity Framework and Code First - Entity Framework Design

http://blogs.msdn.com/b/efdesign/archive/2010/03/30/data-annotations-in-the-entity-framework-and-code-first.aspx
http://blogs.msdn.com/b/adonet/archive/2011/03/15/ef-4-1-code-first-walkthrough.aspx

EF 4.1 Code First Walkthrough - ADO.NET team blog

The information in this post is out of date. Visit msdn.com/data/ef for the latest information on current and past releases of EF. For Code First to a New Database see http://msdn.com/data/jj193542 For Code First to an Existing Database see http://msdn.com/data/jj200620
http://refactorthis.wordpress.com/2011/05/31/mock-faking-dbcontext-in-entity-framework-4-1-with-a-generic-repository/

Faking DbContext in Entity Framework 4.1 with a generic repository « REFACTOR (this)

Update 30/11/2011: FakeDbSet implementation update Please see the new and improved FakeDbSet Here Update 16/06/2011: Added step (2) description of how to implement Set<>() method in your original DbContext so that it returns IDbSet<>. Also added SaveChanges() to expose the context as a unit of work. + A little reorganisation. Faking of the new Entity Framework 4.1 DbContext can be done quite simply by following these steps: 1. Create a common interface for your particular DbContext type.

Repository Pattern with Entity Framework 4.1 and Code First

http://www.codeproject.com/Tips/309753/Repository-Pattern-with-Entity-Framework-4-1-and-C Introduction A popular pattern for ORM data access is the Repository pattern. Repositories are currently very popular even in EF for the reasons below:
Julie Lerman March 2011 Watch a video of this content Download the code for this article: Microsoft’s ADO.NET Entity Framework (EF) simplifies data access by allowing you to avoid working directly with the database in your code. Instead you can retrieve data by writing queries against strongly typed classes letting the Entity Framework handle the database interaction on your behalf. http://msdn.microsoft.com/en-us/data/gg685494.aspx

Building an MVC 3 App with Model First and Entity Framework 4.1

[This topic is pre-release documentation and is subject to change in future releases. Blank topics are included as placeholders.] In this task, you will create strongly-typed queries against the CLR objects that represent entities and associations in the School model, and bind display controls to the object collections returned from these queries. At the beginning of the code file for the CourseViewer form, add the following using (C#) or Imports (Visual Basic) statements to reference the model created from the School database and the entity namespace.

Querying Entities and Associations

http://msdn.microsoft.com/en-us/library/bb386884.aspx

Getting Started (Entity Framework)

The ADO.NET Entity Framework supports data-centric applications and services, and provides a platform for programming against data that raises the level of abstraction from the logical relational level to the conceptual level. By enabling developers to work with data at a greater level of abstraction, the Entity Framework supports code that is independent of any particular data storage engine or relational schema. For more information, see Entity Framework Overview . http://msdn.microsoft.com/en-us/library/bb386876.aspx
http://blogs.msdn.com/b/efdesign/archive/2010/06/01/conventions-for-code-first.aspx The latest preview of Code First allows you to describe a model using C# or VB.Net classes. The basic shape of the model is detected by convention and then a fluent API can be used to further refine your model. We recently posted about our plans to support Data Annotations as another way to further describe your model. We are now looking at extending and improving the conventions that initially infer the shape of the model. This post describes the conventions we are planning to include.

Conventions for Code First - Entity Framework Design

http://weblogs.asp.net/scottgu/archive/2010/07/16/code-first-development-with-entity-framework-4.aspx .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:

Code-First Development with Entity Framework 4

EF 4.1 Released - ADO.NET team blog

http://blogs.msdn.com/b/adonet/archive/2011/04/11/ef-4-1-released.aspx I get the following error after I try to add DbContext generator to the project: Error 1 Running transformation: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.IO.FileNotFoundException: Unable to locate file Server stack trace: at Microsoft.VisualStudio.TextTemplating.VSHost.TextTemplatingService.ResolvePath(String path) at System.Runtime.Remoting.Messaging.StackBuilderSink.