Digbyswift is based in Leeds, West Yorkshire offering web and digital solutions. With over a decade of experience in corporate and agency web development, Digbyswift can meet and support your requirements, whether it be MVC or web forms development, Umbraco, bespoke CMS build and maintenance, ecommerce, SEO and Google analytics or even client training. Read more ...

LINQ to SQL, NHibernate or Entity Framework? Do I have a choice?

By Digbyswift at March 31, 2011 12:32

I love NHibernate. But over the last year I’ve found myself starting to use LINQ to SQL more and more.

Most recently I have taken a contract where they use only LINQ to SQL and so I’ve allowed myself to become immersed in it for a while. I realised that I can achieve everything from small to medium weight projects with LINQ to SQL where-as before I was reserving NHibernate for the medium to larger projects, and this is the problem.

I’ve invested a substantial amount of time learning NHibernate and also creating a library which allows me to implement it with relative ease into any web-based project. Essentially, it hides the session handling completely and configuration to varying degrees.

Larger projects are generally few and far between in comparison. So I am using LINQ to SQL more than I would. Obviously, the next step is fore me to start using Microsoft’s Entity Framework (EF). And when this happens do I give up NHibernate?

I’ve been avoiding picking up EF for this very reason. Am I cutting off my nose to spite my face? I just don’t know if I have enough room in my brain for yet another ORM framework.

I guess my hand may be forced. Let’s see.