Share via


Entity Framework

This portal page will eventually link you to all the most valuable material about ADO.Net Entity Framework.

Entity Framework is Microsoft's "Object/Relational Mapper" software that bridges the gap between the object-oriented world of .Net developers, and the relational database world of SQL Server.

Entity Framework provides 3 different development methodologies:

  • Model First: use a Visual Designer to create a conceptual model, and then generate the database, and the  .Net code that maps to it;
  • Database First: use an existing SQL Server database to generate the conceptual model and the mapped .Net code;
  • Code First: create an object model using .Net Code, then generate the conceptual model from it, and also the database. Using Code First, you can also map the model to an existing database.

Entity Framework FAQs

The portal page for the Entity Framework Frequently Asked Questions is here: [[articles:Entity Framework FAQ]] .

The FAQs used to reside on a separate web site, but have been moved to this wiki so that you the developer can not only benefit and learn from the questions, but can also contribute your own insights and knowledge.

Topics for the next major release of Entity Framework

This section describes topics that are or will be worked on for the next release. Some of these topics will be written on this wiki, and be available prior to release, or to be more specific, when I get them written. Some of this content may appear in MSDN when the release happens.

One kind of "topic" will be creating end-to-end applications. Another kind is the "White Paper": detailed treatment of a specific feature or problem.

Entity Framework End-to-End Application

We'd like to create semi-realistic end-to-end applications as one way of documenting the Entity Framework. Our hope is that by doing this, we will accomplish several things:

  • provide developers with a useful sample that they can learn from, and see live working features
  • share your pain: find out what parts of the product need further work
  • find bugs in early public releases of the product
  • learn by doing: although we have the advantage of being able to talk directly to the product team, at times the best way to learn and understand something is to "just do it!"

I'm going to post notes of the design and development process here on the wiki, as we go along, to encourage community involvement. After all, if the application is going to be semi-realistic, well, our customers are likely the best source for that realism.

Right now I have two projects in mind. each one centers on exercising significant parts of Entity Framework:

  • a SQL Server spatial app that is focused on new features of the June 2011 CTP release
  • a migration project that tries out incremental development and updates of a SQL Server database application

 

SQL Server spatial application

This application will use Entity Framework features that are new in the June 2011 CTP release, such as:

  • SQL Server spatial features
  • enums
  • table-valued functions

Design discussions for this project have already begun. The wiki page for this project is at: [[SQL Server Spatial Application]].

We're at a quite preliminary stage right now, so please contribute with suggestions about what would make a good application.

Migration Application

This seems like an obvious candidate for a project, but we haven't started on it yet.

Entity Framework and SQL Server Azure

Customers have encountered 2 problem areas here:

  • connections drop: when database connections drop, user-written code is needed to handle to logic of reconnecting
  • Federation: when a SQL Azure database is sharded there are a number of possible problems, including for example, what to do about a query that is running when the sharding starts

Ultimately one might hope that the Entity Framework itself would handle these scenarios. I cannot give you specific time frames, but the product team is well-aware of these issues. Meanwhile, you need to write "plumbing" code yourself to handle them. This is a topic we'd like to get into MSDN for the next major release of Entity Framework, and which I will write about before that.
 

See also

Relationship in Entity Framework Using Code First Approach With Fluent API 

Entity Framework: Wiki portal 

Entity Framework Introduction using C#, Part I 

Entity Framework Code First -Defining Foreign Keys using Data Annotations and Fluent API 

Entity Framework TechNet 

Moving from ADO.NET To Entity Framework 

Windows forms Entity Framework Code first from database 

Getting Started with Entity Framework Core: Database-First Development 

Entity Framework FAQ: Concurrency 

Entity Framework FAQ: Conceptual Model (EDM)