Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ls LINQ an ORM (Object Relational Mapper)?

Tags:

orm

linq

Is LINQ an ORM ?

I've heard a lot of people say LINQ follows the rules of an Object Relation Mapper. But I don't understand; is this true?

like image 576
Kumar Manish Avatar asked Nov 17 '11 07:11

Kumar Manish


2 Answers

LINQ is a C#/VB.NET language syntax and a set of method signatures for querying data.

There are many providers for this syntax and some of them are ORMs. The simplest case is when you are querying collections in memory which is not an ORM. There are also ways to query XML, Active Directory and many others which are not ORMs using the same syntax and the same set of methods (implemented differently).

Practically every serious .NET ORM technology has some level of LINQ support

LINQ to SQL is the first ORM to support LINQ and it was kind of a proof of concept. It is easy to learn and lightweight but lacks a lot of features. It is still pretty decent and Stack Overflow used it (I'm not sure if they still use it). Entity Framework has LINQ to Entities provider and it is the heavy hitter from Microsoft. NHibernate has a LINQ provider that in my opinion barely works but they may fix it some day

There are more ORMs out there and most of them have some level of LINQ support.

like image 162
Stilgar Avatar answered Sep 30 '22 01:09

Stilgar


Ok people, repeat after me:

LINQ is NOT about working with databases.

LINQ is an abstraction layer for working with data which allows for set based operations, projections, filters, etc on anything that can be enumerated over. It just happens to have providers for working with relational data (LINQ to SQL, LINQ to Datasets, LINQ to Entities).

like image 37
Jim Wooley Avatar answered Sep 30 '22 02:09

Jim Wooley