Entity Framework

TwitterFacebook
Get flash to fully experience Pearltrees
Alternate Technologies

The Entity Framework provides a set of canonical functions that implement functionality that is common across many database systems, such as string manipulation and mathematical functions. http://msdn.microsoft.com/en-us/library/bb738681.aspx

CLR Method to Canonical Function Mapping

EDM: Mapping two entities from single table

http://social.msdn.microsoft.com/forums/en-US/adodotnetentityframework/thread/73da591f-0c53-4485-8f4a-07122808f9f7/ Everythings always more complicated than it originally appears - if it looks easy, it's tough, if it looks tough, it's damn near impossible. Anyway... 1) The complex type won't work - I really like them, don't get me wrong, but they're not first class objects within the context of the framework because they can't participate in relationships - they're a great way to encapsulate dumb data but they're basically nested class definitions, not sibling classes that can be composed together
http://social.msdn.microsoft.com/forums/en-US/adodotnetentityframework/thread/136d8499-699a-4703-adc5-ac696d00496e/ Well, this is certainly a big topic, and let me reassure you that it is something we have thought a lot about and are designing for in the long-term. Given the timeframes involved and the scope of the entity framework, one big challenge has been to put together a long-term design that will get us where we want to go and then figure out how to deliver something of value in our first release that we can build on to get toward the final vision over the course of more than one release. I think we're on track for that.

Persistence Ignorance in the Entity Framework

using (ObjectContext ctx = new ObjectContext( "Name=NorthwindEntities3" )) { var query = from s in ctx.CreateQuery ( "NorthwindEntities3.Shippers" ) where s.CompanyName == "Speedy Express" select s; foreach (Shipper s in query) { System.Console.WriteLine(s.ShipperID); } } Or, given that if I've used the tooling to produce a derived NorthwindContext or similar which has a property called Shippers on it then I can shorten that down to; using (NorthwindContext ctx = new NorthwindContext()) { var query = from s in ctx.Shippers where s.CompanyName == "Speedy Express" select s; foreach (Shipper s in query) { System.Console.WriteLine(s.ShipperID); } } http://mtaulty.com/CommunityServer/blogs/mike_taultys_blog/archive/2007/09/05/9751.aspx

ADO.NET Entity Framework - LINQ. Getting Started. - Mike Taulty's Blog - Mike Taulty's Blog

ADO.NET Entity Framework - Bringing Together A Few Previous Posts - Mike Taulty's Blog - Mike Taulty's Blog

Where I'd like to go with this next is to explore more into LINQ and also more around what you can do with mapping (almost everything I've looked at so far has been a 1:1 Conceptual:Logical). http://mtaulty.com/CommunityServer/blogs/mike_taultys_blog/archive/2007/08/29/9691.aspx
http://msdn.microsoft.com/en-us/magazine/cc163399.aspx Browse the Code Online [ Editor's Update - 6/19/2007: The ADO.NET Entity Framework and Tools will ship during the first half of 2008 as an update to the Visual Studio 2008 release.] ADO.NET in the next release of Visual Studio ® code-named "Orcas" features the new Entity Framework. It allows developers to focus on data through an object model instead of through a logical/relational data model.

Data Points: ADO.NET Entity Framework Overview

http://www.digitallycreated.net/Blog/37/dynamic-queries-in-entity-framework-using-expression-trees

Dynamic Queries in Entity Framework using Expression Trees | DigitallyCreated

Most of the queries you do in your application are probably static queries.

The cost of eager loading in Entity Framework : Don't Be Iffy

Everything in life is about choices and usually we have to evaluate our options before we make those choices. So it goes with eager loading vs. deferred loading in Entity Framework. http://thedatafarm.com/blog/data-access/the-cost-of-eager-loading-in-entity-framework/
With the Entity Framework most of the time SaveChanges() is sufficient.

c# - Entity Framework - Using Transactions or SaveChanges(false) and AcceptAllChanges()? - Stack Overflow

http://stackoverflow.com/questions/815586/entity-framework-using-transactions-or-savechangesfalse-and-acceptallchanges
On the other hand, if you are creating an expression tree and your expression requires a property value access in order for it to evaluate, you should use Expression.MemberAccess or Expression.Property:

Enumerate properties of an Entity Object

LINQ to Entities: Combining Predicates - meek - Site Home - MSDN Blogs

Someone asked a great question on the ADO.NET Entity Framework forums yesterday: how do I compose predicates in LINQ to Entities? I’ll give three answers to the question.

Entity Framework messes up Primary Keys of Views - A work around

After adding a couple of Views to my Entity Data Model, I noticed that EF had messed up the Primary keys of my entities (based on the views).