Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 610
ngnewb Avatar asked May 12 '16 14:05

ngnewb


1 Answers

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.

like image 100
VahidNaderi Avatar answered Oct 04 '22 17:10

VahidNaderi