Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Using EF4 will save you <strong>a lot</strong> of manual coding - or code generation. That alone seems to justify using it - the best code and the only code guaranteed to be bug-free is the code you don't need to write.</p> <p>EF4 and NHibernate and the like are very powerful tools that can handle the most demanding and complicated business requirements - things like inheritance in database tables and a lot more. They do add some overhead, however - and they're not always easy to learn and pick up.</p> <p>So my provocative question would be: why not use <strong>Linq-to-SQL</strong>? If you only need SQL Server as a backend, if your mappings are almost always a 1:1 mapping between a table and a class in your domain model, this could be a lot easier than using either EF4 or NHibernate.</p> <p>Linq-to-SQL is definitely easier and faster than EF4 - it's just a rather thin layer on top of your database. It's a lot easier than learning NHibernate - no messy mapping syntax to learn, you have support through a visual designer. And it's simple enough that you can even get in there and manipulate the code generation using e.g. T4 templates (see Damien Guard's <a href="http://l2st4.codeplex.com/" rel="nofollow noreferrer">Linq-to-SQL templates</a>).</p> <p>Linq-to-SQL is 100% supported even in .NET 4 / VS 2010, so there's a really good chance it will still be around in VS2012 (or whatever the next one will be called). So all those doomsday predictions about its demise are largely exaggerated - I wouldn't worry about it's future proofness for a second.</p> <p><strong>UPDATE:</strong> Some performance comparisons between Linq-to-SQL and EF:</p> <ul> <li><a href="http://toomanylayers.blogspot.com/2009/01/entity-framework-and-linq-to-sql.html" rel="nofollow noreferrer">Entity Framework and Linq-to-SQL Performance Comparison</a></li> <li><a href="http://thedatafarm.com/blog/data-access/looking-at-ef-performance-some-surprises/" rel="nofollow noreferrer">Looking at EF Performance - some surprises</a></li> <li><a href="http://srtsolutions.com/public/blog/250822" rel="nofollow noreferrer">Entity Framework and LINQ to SQL</a></li> </ul> <p>In general, Linq-to-SQL seems to have an edge on query performance, but EF seems to be doing better on updates.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload