Geeks With Blogs
Keith Nicholas

Now I’m not an expert in either of these techs.  I have a nice framework for unit of work / repository built with NHibernate.  Works pretty well.  I use FluentNhibernate to do the mappings.  Works well.  Takes very little code to get going with a DB back OO model.

So why swap?

Linq.  In Entity Framework you get much better linq support. 

Visibility. I have no idea what's really happening with NHibernate….its a cloud of mystery most of the time.  You have to read all the blogs, mailing lists, etc to know what's going on.

So, EF 4.0 looks like pretty good….  it has reasonably good support for mapping POCOs.  Wrapping UnitOfWork and Repository around it seems ok.

Only thing I haven’t liked too much is having to explicitly load lazy loading entities.

So…. am I sane?  is EF the way to go?  or is NHibernate going to suddenly release the next generation of coolness?  Is there any other major gotchas of using EF over NHibernate?

Posted on Thursday, April 29, 2010 2:11 PM | Back to top


Comments on this post: Swapping from NHibernate to Entity Framework – Sanity Check

# re: Swapping from NHibernate to Entity Framework – Sanity Check
Requesting Gravatar...
I feel the same way you do and my company is pushing on with EF.
Left by NA on Apr 30, 2010 12:12 AM

# re: Swapping from NHibernate to Entity Framework – Sanity Check
Requesting Gravatar...
With EF4 you should be able to turn on lazy loading and not need to explicitly load. The only trick is that you need to make sure your collection and reference properties are virtual and you need to set the LazyLoadingEnabled property to true on ContextOptions.

- Danny
Left by Daniel Simmons on Apr 30, 2010 10:30 AM

Your comment:
 (will show your gravatar)


Copyright © DesigningCode | Powered by: GeeksWithBlogs.net | Join free