score:18
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.
score:5
linq is language intergrated query and is not an orm.
it can be used as query layer on top of an orm product like entity framework or telerik open access or nhibernate.
orm is as you say object relation mapper - it does mapping between entities in the database layer to entities into your object oriented code - classes that represent the database in your application.
for further discussion see this question.
score:6
if we were to go by the wiki defiinition of the term object-relational mapping,
object-relational mapping (orm, o/rm, and o/r mapping) in computer software is a programming technique for converting data between incompatible type systems in object-oriented programming languages. this creates, in effect, a "virtual object database" that can be used from within the programming language. there are both free and commercial packages available that perform object-relational mapping, although some programmers opt to create their own orm tools. http://en.wikipedia.org/wiki/object-relational_mapping
then yes, linq is an orm in the sense that it is a programming technique for converting(and querying) data between incompatible systems in object-oriented programming languages, creating, in effect, a "virtual object database" that can be used from within the programming language.
score:9
is the linq orm ?
no. linq is not itself an orm.
this code uses linq to objects, which is still valid linq:
var somedata = new int[] { 5, 3, 2, 7, 4 };
var someresults = somedata
.orderbydescending(i => i)
.take(3)
;
and here is some linq to xml code:
ienumerable<xelement> partnos =
from item in purchaseorder.descendants("item")
where (int) item.element("quantity") *
(decimal) item.element("usprice") > 100
orderby (string)item.element("partnumber")
select item;
neither of these code samples have anything to do with object relational mapping, since they don't map objects, nor do they work with relational databases.
linq has been used with some orm technologies though:
- linq to entities allows you to access the entity framework orm with linq.
- linq to nhibernate does the same for nhibernate.
you can find out how linq itself works by checking out this library and the associated articles. they deal with linq to objects, but will give you the basis of how linq itself works:
http://code.google.com/p/edulinq/
it will show you that linq need not have anything to do with an orm.
score:13
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).
Source: stackoverflow.com
Related Query
- ls LINQ an ORM (Object Relational Mapper)?
- LINQ Source Code Available
- Linq with where clause in many-to-many EF Code First object
- creating Linq to sqlite dbml from DbLinq source code
- Linq to sql as object data source - designer problem with partial classes
- Convert this LINQ code back to a Loop (or Why is this object sometimes null)
- convert linq to object query to sql query (no linq to sql code or datacontext)
- Linq selecting object from relational list of object by search keyword
- source code for LINQ 101 samples
- Linq code to get the index of an object in an array from an object within a list
- Create a tree structure in linq with a single list source with parent - child as strings of an object
- How to output a relational object using Linq on View models in Entity Framework Core
- Check Nullable for object insde LinQ to Sql code
- c# Linq or code to extract groups from a single list of source data
- nullable object must have a value error in linq to sql in vb.net code
- How to use LINQ to select object with minimum or maximum property value
- Deserializing JSON to .NET object using Newtonsoft (or LINQ to JSON maybe?)
- Convert string[] to int[] in one line of code using LINQ
- LINQ Group By into a Dictionary Object
- Code equivalent to the 'let' keyword in chained LINQ extension method calls
- How can I get LINQ to return the object which has the max value for a given property?
- Create a list from two object lists with linq
- Linq code to select one item
- How to get first object out from List<Object> using Linq
- Return list of specific property of object using linq
- How are people unit testing code that uses Linq to SQL
- LINQ selection by type of an object
- LINQ - Does the Where expression return new instance or reference to object instance
- LINQ to SQL: GroupBy() and Max() to get the object with latest date
- Linq select to new object
More Query from same tag
- System.IO - Use Directory/LINQ to Replace Some Files in a List with Others
- Trouble with linq left join only including values that are a match
- Need help querying through 3 classes
- Do you choose Linq over Forloops?
- LINQ SQL query check if a object field is not null
- LINQ order by local list
- Is ProxyCreationEnabled = false is equal to AsNoTracking() in Entity framework?
- How to determine duplicates in list of strings in c#?
- Type inference failed in the call to 'Join' when using anonymous type
- Passing delegate to linq query in EF Core
- Entity Framework JOINs when datatype does not match
- OrderBy clause before Where clause - performance?
- WCF Data Services + LINQ Projection into a custom type
- Missing GetTable<TEntity>() in database context
- How to do "nested" eager loading in Entity Framework?
- Check if List<object> contains all integers
- Need to convert Left join SQL to linq query - help appreciated
- Expression tree for child collection List<string>.Any
- using a text string as mini database with linq
- Accessing nested child nodes?
- How to convert from Newton.Json.Linq.JToken to byte[]?
- Error while inserting data with LINQ to SQL
- Use LINQ to compare items in a list
- LINQ - How to Flatten List<List<string>> where strings are pipe-delimited
- Is there a way to avoid repetition in linq projections that depend on expressions?
- Bulk insert to SQL Server with linq
- Linq Query relating Many to Many relationship
- find list of one item not in second list
- How to obtain a list of elements contained in multiple list using LINQ?
- Query to filter data based conditions in child table