{STATIC} hippo

...on becoming a great developer...
posts - 39, comments - 14, trackbacks - 0

My Links

Archives

Post Categories

Entity Framework

Entity Framework
Huge EFing Bug!

Thanks to Keith (comment #1 at http://weblogs.asp.net/johnkatsiotis/archive/2010/04/28/huge-ef4-inheritance-bug.aspx#7464062) for that title, btw. After coming from NHibernate, EF4 is an enormous pain to work with.  Unlike NHibernate, which basically lets you map any relationship you can dream of, EF4 has a lot of issues with inheritance.  Here’s a pretty big one IMO: Take a look at this object hierarchy: Before I continue, if you think we’re working on an edge case I have to disagree.  One of the tenets of OOP is the idea of encapsulation – there’s no reason a base class shouldn’t be able...

posted @ Tuesday, June 08, 2010 2:49 PM | Feedback (0) | Filed Under [ c# Entity Framework ]

EntityFramework caching woes

When you retrieve an entity from the database, Entity Framework handles lazy loading for you by creating a proxy for your model class.  There is, however, a little caveat.  Take the following code: 1: using (MSEntities ent = new MSEntities("name=MSEntities")) 2: { 3: // I already added Microsoft to the database, with ID 1 4: Employee billGates = new Employee() ...

posted @ Tuesday, June 01, 2010 12:25 PM | Feedback (0) | Filed Under [ Entity Framework ]

EntityFramework should throw more exceptions!

I’m working on a new project using .NET4, MVC2 and EntityFramework.  For the last couple years I’ve been using NHibernate as my ORM of choice but there are a lot of similarities between NHibernate and EntityFramework actually so the learning curve is quite small.  There are a number of things that make me long for NHibernate, but one stands out in my mind: lazy loading.  One of my first issues with EF was trying to track down a bug: ClassA has a property reference to ClassB, but the property is always null even when ClassB exists in the database.  After...

posted @ Friday, May 28, 2010 12:05 PM | Feedback (0) | Filed Under [ NHibernate Entity Framework ]

Powered by:
Powered By Subtext Powered By ASP.NET