Which ORM should i be using for .Net in 2016 to talk to SQL server?

.net asp.net entity-framework linq orm


Most of my server side experience is with nodeJS meteor or rails so i dont have a wealth of .Net knowledge yet. In rails its pretty easy to pick on ORM because ActiveRecord is the only game in town or so it seems. My approach was typically query everything you can using the ORM and if you cant pull it off then drop down to raw SQL.

However I am trying to read tutorials and lessons on querying my databases in .Net 4.5 or newer apps and I am confused on what the way of the future is. I see tutorials in the following

  • Linq Lambda syntax
  • Linq Query syntax
  • Entity Framework

What is the suggested ORM for modern .net apps? It seems like i can do basic CRUD operations in all of the above. But will one be better suited for say joins across tables? Mind you I only ever plan to query against Microsoft SQL server databases for my .net solutions.

what really confused me is reading that EF replaced linq but then reading that EF also uses linq. So when i see an example to say select all columns i dont know if i am using a syntax of the past or future. Also just looking at code i cant tell if its linq or EF. I can tell if its query or lambda syntax though.

5/12/2016 2:31:40 PM

Accepted Answer

The options you mentioned are not all ORMs, in this 3 the only ORM is EF. there are other popular ORMs in .net including:

  • NHibernate
  • LLBLGen pro
  • ActiveRecord

Most of them support LINQ. EntityFramework is the younger one but it's integration with VS and being available out of the box is making it the most popular ORM in .net and it replaced LINQ to Entities not LINQ itself. LINQ (Language-Integrated Query) as defined in msdn can be used with different datasources.

LINQ is a set of features that extends powerful query capabilities to the language syntax of C#. LINQ introduces standard, easily-learned patterns for querying and updating data, and the technology can be extended to support potentially any kind of data store. The .NET Framework includes LINQ provider assemblies that enable the use of LINQ with .NET Framework collections, SQL Server databases, ADO.NET Datasets, and XML documents.

There are two different syntaxes to use LINQ mostly known as Fluent syntax and Query syntax.

If your new to .net as you mentioned, I suggest using EF with fluent syntax it would be the quickest way to start querying database in .net.

8/21/2017 2:09:06 AM

Popular Answer

The short answer is Entity Framework.

I think what's confusing you is that you can use Linq Lambda and Linq Query syntax with Entity Framework. But the future (in my opinion) is Fluent API.

I've been using Entity Framework 7 (pre-release) and I get the impression that it's focused on Fluent API. Which is fine with me because I like it much better than Linq syntax.

Related Questions


Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow