All Topics  
Language Integrated Query

 

   Email Print
   Bookmark   Link






 

Language Integrated Query



 
 
Language Integrated Query (LINQ, pronounced "link") is a Microsoft
Microsoft

Microsoft Corporation is a multinational corporation computer technology corporation that develops, manufactures, licenses, and supports a wide range of computer software products for computing devices....
 .NET Framework
.NET Framework

The Microsoft .NET Framework is a software framework that is available with several Microsoft Windows operating systems. It includes a large Library of coded solutions to prevent common programming problems and a virtual machine that manages the execution of programs written specifically for the Software framework....
 component that adds native data querying
Query language

Query languages are computer languages used to make query into databases and information systems.Broadly, query languages can be classified according to whether they are database query languages or information retrieval query languages....
 capabilities to .NET languages.

Microsoft LINQ defines a set of proprietary query operators that can be used to query, project and filter data in array
Array

In computer science, an array is a data structure consisting of a group of element s that are accessed by index . In most programming languages each element has the same data type and the array occupies a contiguous area of computer memory....
s, enumerable class
Class (computer science)

In object-oriented programming, a class is a programming language construct that is used as a blueprint to create Object s. This blueprint includes Attribute s and Method s that the created objects all share....
es, XML (XLINQ), relational database
Relational database

A relational database is a database that groups data using common attributes found in the data set. The resulting "clumps" of organized data are much easier for people to understand....
, and third party data sources. While it allows any data source to be queried, it requires that the data be encapsulated as objects
Object (computer science)

In its simplest embodiment, an object is an allocated region of storage. Since programming languages use variable#Computer_programmings to access objects, the terms object and variable are often used interchangeably....
.






Discussion
Ask a question about 'Language Integrated Query'
Start a new discussion about 'Language Integrated Query'
Answer questions from other users
Full Discussion Forum



Encyclopedia


Language Integrated Query (LINQ, pronounced "link") is a Microsoft
Microsoft

Microsoft Corporation is a multinational corporation computer technology corporation that develops, manufactures, licenses, and supports a wide range of computer software products for computing devices....
 .NET Framework
.NET Framework

The Microsoft .NET Framework is a software framework that is available with several Microsoft Windows operating systems. It includes a large Library of coded solutions to prevent common programming problems and a virtual machine that manages the execution of programs written specifically for the Software framework....
 component that adds native data querying
Query language

Query languages are computer languages used to make query into databases and information systems.Broadly, query languages can be classified according to whether they are database query languages or information retrieval query languages....
 capabilities to .NET languages.

Microsoft LINQ defines a set of proprietary query operators that can be used to query, project and filter data in array
Array

In computer science, an array is a data structure consisting of a group of element s that are accessed by index . In most programming languages each element has the same data type and the array occupies a contiguous area of computer memory....
s, enumerable class
Class (computer science)

In object-oriented programming, a class is a programming language construct that is used as a blueprint to create Object s. This blueprint includes Attribute s and Method s that the created objects all share....
es, XML (XLINQ), relational database
Relational database

A relational database is a database that groups data using common attributes found in the data set. The resulting "clumps" of organized data are much easier for people to understand....
, and third party data sources. While it allows any data source to be queried, it requires that the data be encapsulated as objects
Object (computer science)

In its simplest embodiment, an object is an allocated region of storage. Since programming languages use variable#Computer_programmings to access objects, the terms object and variable are often used interchangeably....
. So, if the data source does not natively store data as objects, the data must be mapped
Object-relational mapping

Object-relational mapping is a Computer programming technique for converting data between incompatible type systems in relational databases and object-oriented programming languages....
 to the object domain. Queries written using the query operators are executed either by the LINQ query processing engine or, via an extension mechanism, handed over to LINQ providers which either implement a separate query processing engine or translate to a different format to be executed on a separate data store (such as on a database server as SQL
SQL

SQL is a database computer language designed for the retrieval and management of data in relational database management systems , database schema creation and modification, and database object access control management....
 queries (DLINQ)). The results of a query are returned as a collection of in-memory objects that can be enumerated
Enumeration

In mathematics and theoretical computer science, the broadest and most abstract definition of an enumeration of a Set is an exact listing of all of its element s ....
 using a standard iterator
Iterator

In computer science, an iterator is an object that allows a programmer to traverse through all the elements of a Collection , regardless of its specific implementation....
 function such as C#'s foreach
Foreach

For each is a computer language idiom for traversing items in a Collection class. Foreach is usually used in place of a standard for loop statement ....
.

Many of the concepts that LINQ has introduced were originally tested in Microsoft's C?
C?

C? is a free extension to the C Sharp programming language, developed by the WebData team in Microsoft SQL Server in collaboration with Microsoft Research in the United Kingdom and Redmond....
 research project. LINQ was released as a part of .NET Framework 3.5 on November 19, 2007.

Architecture of LINQ in .Net Framework 3.5


Standard Query Operators

The set of query operator
Operator (programming)

Programming languages generally support a set of operators that are similar to operator. A language may contain a fixed number of built-in operators or it may allow the creation of programmer-defined operators ....
s defined by LINQ are exposed to the user as the Standard Query Operator API. The query operators supported by the API are: Select / SelectMany: The Select statement is used to perform a projection on the collection to select either all the data members that make up the object or a subset of it. The SelectMany operator is used to perform a one-to-many projection, i.e., if the objects in the collection contain another collection as a data member, SelectMany can be used to select the entire sub-collection. The user supplies a function, as a delegate
Delegate (.NET)

A delegate is a form of Type safety function pointer used by the .NET Framework. Delegates specify a Method to call and optionally an Object to call the method on....
, which projects the data members. Selection creates an object of a different type, which has either some or as many data members as the original class. The class must be already defined for the code to be compilable
Compiler

A compiler is a computer program that transforms source code written in a programming language into another computer language . The most common reason for wanting to transform source code is to create an executable program....
. Where: The Where operator allows the definition of a set of predicate rules which are evaluated for each object in the collection, and objects which do not match the rule are filtered away. The predicate is supplied to the operator as a delegate. Sum / Min / Max / Average / Aggregate: These operators take a predicate that retrieves a certain numeric value from each element in the collection and uses it to find the sum, minimum, maximum, average or aggregate values of all the elements in the collection, respectively. Join / GroupJoin: The Join operator performs an inner join on two collections, based on matching keys for objects in each collection. It takes two functions as delegates, one for each collection, that it executes on each object in the collection to extract the key from the object. It also takes another delegate via which the user specifies which data elements, from the two matched elements, should be used to create the resultant object. The GroupJoin operator is used to perform a group join. Like the Select operator, the results of a join are instantiations of a different class, with all the data members of both the types of the source objects, or a subset of them. Take / TakeWhile: The Take operator is used to select the first n objects from a collection, while the TakeWhile operator, which takes a predicate, selects those objects which match the predicate. Skip / SkipWhile: The Skip and SkipWhile operators are complements of Take and TakeWhile - they skip the first n objects from a collection, or those objects which match a predicate (for the case of SkipWhile). OfType: The OfType operator is used to select the elements of a certain type. Concat: The Concat operator concatenates
Concatenation

In computer programming, string concatenation is the operation of joining two character string end to end. For example, the strings "snow" and "ball" may be concatenated to give "snowball"....
 two collections. OrderBy / ThenBy: The OrderBy operator is used to specify the primary sort ordering of the elements in a collection according to some key. The default ordering is in ascending order, to reverse the order the OrderByDescending operator is to be used. ThenBy and ThenByDescending specifies subsequent ordering of the elements. The function to extract the key value from the object is specified by the user as a delegate. Reverse: The Reverse operator reverses a collection. GroupBy: The GroupBy operator takes a delegate that extracts a key value and returns a collection of IGrouping objects, for each distinct key value. The IGrouping objects can then be used to enumerate all the objects for a particular key value. Distinct: The Distinct operator removes duplicate instances of a key value from a collection. The function to retrieve the key value is to be supplied as a delegate. Union / Intersect / Except: These operators are used to perform a union
Union (set theory)

In set theory, the term Union refers to a set operation used in the convergence of set elements to form a resultant set containing the elements of both sets....
, intersection
Intersection (set theory)

In mathematics, the intersection of two Set A and B is the set that contains all elements of A that also belong to B , but no other elements....
 and difference
Complement (set theory)

In discrete mathematics and predominantly in set theory, a complement is a concept used in comparisons of sets to refer to the unique values of one set in relation to another....
 operation on two sequences, respectively. EqualAll: The EqualAll operator checks if all elements in two collections are equal. First / FirstOrDefault / Last / LastOrDefault: These operators take a predicate. The First operator returns the first element for which the predicate yields true or throws an exception if nothing matches. The FirstOrDefault operator is like the First operator except that it returns the default value for the element type (usually a null reference) in case nothing matches the predicate. The last operator retrieves the last element to match the predicate, or throws an exception in case nothing matches. The LastOrDefault returns the default element value if nothing matches. Single: The Single operator takes a predicate and returns the element which matches the predicate. An exception is thrown if none or more than one elements match the predicate. ElementAt: The ElementAt operator retrieves the element at a given index in the collection. Any / All / Contains: The Any operator checks if there are any element in the collection matching the predicate. It does not select the element, but returns true for a match. The All operator checks if all elements match the predicate. The Contains operator checks if the collection contains a given value. Count: The Count operator counts the number of elements in the given collection.

The Standard Query Operator also specifies certain operators which converts a collection into other types:
  • AsEnumerable: converts the collection to IEnumerable type.
  • ToQueryable: converts the collection to IQueryable type.
  • ToArray: converts the collection to an array.
  • ToList: converts the collection to IList type.
  • ToDictionary: converts the collection to IDictionary type, indexed by the key K.
  • ToLookup: converts the collection to ILookup type, indexed by the key K.
  • Cast: converts a non-generic IEnumerable collection to one of IEnumerable by casting each element to type T. Throws an exception for incompatible types.
  • OfType: converts a non-generic IEnumerable collection to one of IEnumerable. Only elements of type T are included.


The query operators are defined in the IEnumerable interface as generic
Generic programming

Generic programming is a style of computer programming in which algorithms are written in terms of to-be-specified-later types that are then instantiated when needed for specific types provided as parameters and was pioneered by Ada which appeared in 1983....
 extension method
Extension method

An extension method is a new language feature of C Sharp starting with the 3.0 specification, as well as VB.NET starting with 9.0 and Oxygene_ with 2.0....
s, and a concrete implementation is provided in the Sequence class. As a result, any class which implements the IEnumerable interface has access to these methods and are queryable. LINQ also defines a set of generic
Generic programming

Generic programming is a style of computer programming in which algorithms are written in terms of to-be-specified-later types that are then instantiated when needed for specific types provided as parameters and was pioneered by Ada which appeared in 1983....
 Func delegates, which define the type of delegates handled by the LINQ query methods. Any function wrapped in a Func delegate can be used by LINQ. Each of these methods return an IEnumerable, so the output of one can be used as input to another, resulting in query composability
Function composition

In mathematics, a composite function represents the application of one function to the results of another. For instance, the functions and can be composed by first computing a f and then applying a function g to the output of f....
. The functions, however, are lazily evaluated
Lazy evaluation

In computer programming, lazy evaluation is the technique of delaying a computation until such time as the result of the computation is known to be needed....
, i.e., the collections are enumerated only when the result is retrieved. The enumeration is halted as soon as a match is found, and the delegates evaluated on it. When a subsequent object in the resultant collection is retrieved, the enumeration of the source collection is continued
Continuation

In computing and programming, a continuation is an abstract representation of Control flow, or the "rest of computation" or "rest of code to be executed"....
 beyond the element already evaluated. However, grouping operations, like GroupBy and OrderBy, as well as Sum, Min, Max, Average and Aggregate, require data from all elements in collection, and force an eager evaluation
Eager evaluation

Eager evaluation or strict evaluation is the evaluation strategy in most traditional programming languages.In eager evaluation an Expression is evaluated as soon as it gets bound to a variable....
. LINQ does not feature a query optimizer
Query optimization

Query optimization is a function of many relational database management systems in which multiple query plans for satisfying a query are examined and a good query plan is identified....
 and the query operators are evaluated in the order they are invoked. The LINQ methods are compilable in .NET Framework 2.0, as well.

Language Extensions

While LINQ is primarily implemented as a library for .NET Framework 3.5, it also defines a set of language extensions that can be optionally implemented by languages to make queries a first class language construct and provide syntactic sugar
Syntactic sugar

Syntactic sugar is a term coined by Peter J. Landin for additions to the syntax of a computer language that do not affect its Function but make it "sweeter" for humans to use....
 for writing queries. These language extensions have initially been implemented in C# 3.0, VB 9.0 and Oxygene, with other languages like F# and Nemerle
Nemerle

Nemerle is a high level language static typing programming language for the Microsoft .NET platform. It offers functional programming, object-oriented and imperative programming features....
 having announced preliminary support. The language extensions include:
  • Query syntax: Languages are free to choose a query syntax, which it will recognize natively. These language keywords must be translated by the compiler to appropriate LINQ method calls. The languages can implement operator reordering and other optimizations at the keyword level.
  • Implicitly typed variables: This enhancement allows variables to be declared without specifying their types. The languages C# 3.0 and Oxygene declare them with the var keyword. In VB9.0, the use of the Dim keyword without type declaration accomplishes the same declaration. Such objects are still strongly typed; for these objects the compiler uses type inference
    Type inference

    Type inference, or implicit typing, refers to the ability to deduce automatically the type of a value in a programming language. It is a feature present in some strongly-typed programming language static typing#Static and dynamic typing languages....
     to infer the type of the variables. This allows the result of the queries to be specified and their result defined without declaring the type of the intermediate variables.
  • Anonymous type
    Anonymous type

    Anonymous types are a feature of the C Sharp 3.0, Visual_Basic_.NET#Visual_Basic_2008_.28VB_9.0.29, and Oxygene_ that allows data types to encapsulate a set of read-only properties into a single object without having to first explicitly define a type....
    s: Anonymous types allow classes, which contain only data member declarations, to be inferred by the compiler. This is useful for the Select and Join operators, whose result types may differ from the types of the original objects. The compiler uses type inference to determine the fields contained in the classes and generates accessors and mutators
    Mutator method

    In computer science, a mutator method is a method used to control changes to a variable.The mutator method, sometimes called a "setter", is most often used in object-oriented programming, in keeping with the principle of encapsulation ....
     for these fields.
  • Object Initializer: Object initializers allow an object to be created and initialized in a single scope, this allows creation of delegates that extract fields from an object, create a new object and assign the extracted data to the fields of the new object in a single statement, as is required for Select and Join operators.
  • Lambda expressions: Lambda expressions are used to create delegates inline with other code. This allows the predicates and extraction functions to be written inline with the queries.


For example, in the query to select all the objects in a collection with SomeProperty less than 10,

int someValue = 5;

var results = from c in someCollection let x = someValue * 2 where c.SomeProperty < x select new ;

foreach (var result in results)



the types of variables result, c and results all are inferred by the compiler - assuming SomeCollection is IEnumerable, c will be SomeClass, results will be IEnumerable and result will be SomeOtherClass, where SomeOtherClass will be a compiler generated class with only the SomeProperty and OtherProperty properties and their values set from the corresponding clauses of the source objects. The operators are then translated into method calls as:

IEnumerable results = SomeCollection.Where ( c => c.SomeProperty < (SomeValue * 2) ) .Select ( c => new ) foreach (SomeOtherClass result in results)



LINQ Providers

LINQ also defines another interface, IQueryable, which defines the same interfaces to the Standard Query Operators as IEnumerable. However, the concrete implementation of the interface, instead of evaluating the query, converts the query expression, with all the operators and predicates, into an expression tree
Parse tree

A parse tree or concrete syntax tree is an tree that represents the syntax structure of a string according to some formal grammar. In a parse tree, the interior nodes are labeled by nonterminals of the grammar, while the leaf nodes are labeled by terminal symbol of the grammar....
. The Expression tree preserves the high level structure of the query and can be examined at runtime. The type of the source collection defines which implementation will run - if the collection type implements IEnumerable, it executes the local LINQ query execution engine and if it implements the IQueryable implementation, it invokes the expression tree-based implementation. An extension method
Extension method

An extension method is a new language feature of C Sharp starting with the 3.0 specification, as well as VB.NET starting with 9.0 and Oxygene_ with 2.0....
 is also defined for IEnumerable collections to be wrapped inside an IQueryable collection, to force the latter implementation.

The expression trees are at the core of LINQ extensibility mechanism, by which LINQ can be adapted for any data source. The expression trees are handed over to LINQ Providers, which are data source-specific implementations that adapt the LINQ queries to be used with the data source. The LINQ Providers analyze the expression trees representing the query ("query trees") and generate a DynamicMethod (which are methods generated at runtime) by using the reflection
Reflection (computer science)

In computer science, reflection is the process by which a computer program can observe and modify its own structure and behaviour. The programming paradigm driven by reflection is called reflective programming....
 APIs to emit CIL
Common Intermediate Language

Common Intermediate Language is the lowest-level human-readable programming language in the Common Language Infrastructure and in the .NET Framework....
 code. These methods are executed when the query is run. LINQ comes with LINQ Providers for in-memory object collections, SQL Server databases, ADO.NET
ADO.NET

ADO.NET is a set of computer software components that can be used by programmers to access data and data services. It is a part of the base class library that is included with the .NET Framework....
 datasets and XML documents. These different providers define the different flavors of LINQ:

LINQ to Objects: The LINQ to Objects provider is used for querying in-memory collections, using the local query execution engine of LINQ. The code generated by this provider refer the implementations of the standard query operators as defined in the Sequence class and allows IEnumerable collections to be queried locally. Current implementation of LINQ to Objects uses e.g. O(n) linear search for simple lookups, and is not optimised for complex queries.

LINQ to XML: The LINQ to XML provider converts an XML document to a collection of XElement objects, which are then queried against using the local execution engine that is provided as a part of the implementation of the standard query operator.

LINQ to SQL: The LINQ to SQL provider allows LINQ to be used to query SQL Server databases as well as SQL Server Compact
SQL Server Compact

Microsoft SQL Server Compact is a compact relational database produced by Microsoft for applications that run on mobile devices and desktops. Prior to the introduction of the desktop platform, it was known as SQL Server for Windows CE and SQL Server Mobile Edition....
 databases. Since SQL Server data resides on a remote server, and because it already includes a querying engine, LINQ to SQL does not use the query engine of LINQ. Instead, it converts a LINQ query to SQL
SQL

SQL is a database computer language designed for the retrieval and management of data in relational database management systems , database schema creation and modification, and database object access control management....
 query which is then sent to SQL Server for processing. However, since SQL Server stores the data as relational data
Relational database

A relational database is a database that groups data using common attributes found in the data set. The resulting "clumps" of organized data are much easier for people to understand....
 and LINQ works with data encapsulated in objects, the two representations must be mapped
Object-relational mapping

Object-relational mapping is a Computer programming technique for converting data between incompatible type systems in relational databases and object-oriented programming languages....
 to one another. For this reason, LINQ to SQL also defines the mapping framework. The mapping is done by defining classes which corresponds to the tables in database, and containing all or a subset of the columns in the table as data members. The correspondence, along with other relational model
Relational model

The relational model for database management is a database model based on first-order logic, first formulated and proposed in 1969 by Edgar F. Codd....
 attributes such as primary keys are specified using LINQ to SQL-defined attributes
Attribute (computing)

In computing, an attribute is a specification that defines a property of an object, element, or file. An attribute of an object usually consists of a name and a value; of an element, a type or class name; of a file, a name and extension....
. For example,

[Table(Name="Customers")] public class Customer



this class definition maps to a table named Customers and the two data members correspond to two columns. The classes must be defined before LINQ to SQL can be used. Visual Studio 2008 includes a mapping designer which can be used to create the mapping between the data schemas in the object as well as relational domain. It can automatically create the corresponding classes from a database schema
Database schema

The schema of a database system is its structure described in a formal language supported by the database management system . In a relational database, the schema defines the Table_, the Field in each table, and the relationships between fields and tables....
, as well as allow manual editing to create a different view by using only a subset of the tables or columns in a table.


The mapping is implemented by the DataContext which takes a connection string to the server, and can be used to generate a Table where T is the type that the database table will be mapped to. The Table encapsulates the data in the table, and implements the IQueryable interface, so that the expression tree is created, which the LINQ to SQL provider handles. It converts the query into T-SQL and retrieves the result set from the database server. Since the processing happens at the database server, local methods, which are not defined as a part of the lambda expressions representing the predicates, cannot be used. However, it can use the stored procedure
Stored procedure

A stored procedure is a subroutine available to applications accessing a relational database database management system. Stored procedures are actually stored in the database data dictionary....
s on the server. Any changes to the result set are tracked and can be submitted back to the database server.


LINQ to DataSets: The LINQ to SQL provider works only with Microsoft SQL Server
Microsoft SQL Server

Microsoft SQL Server is a relational database management system produced by Microsoft. Its primary query languages are SQL and Transact-SQL....
 databases; to support any generic database, LINQ also includes the LINQ to DataSets, which uses ADO.NET
ADO.NET

ADO.NET is a set of computer software components that can be used by programmers to access data and data services. It is a part of the base class library that is included with the .NET Framework....
 to handle the communication with the database. Once the data is in ADO.NET
ADO.NET

ADO.NET is a set of computer software components that can be used by programmers to access data and data services. It is a part of the base class library that is included with the .NET Framework....
 Datasets, LINQ to Datasets execute queries against these datasets.

Other providers: The LINQ providers can be implemented by third parties for various data sources as well. Several database server specific providers are available from the database vendors. Some of the popular providers include:

  • Data Services
    ADO.NET Data Services

    ADO.NET Data Services is a platform for what Microsoft calls Data Services. It is actually a combination of the runtime and a web service through which the services are exposed....
    : LINQ to ADO.NET Data Services
  • Entity Framework
    ADO.NET Entity Framework

    ADO.NET Entity Framework is an object-relational mapping framework for the .NET Framework. This framework is an ORM offering from Microsoft for the .NET Framework....
    : LINQ to Entities
  • DbLinq: LINQ to MySQL
    MySQL

    MySQL is a relational database management system which has more than 11 million installations. The program runs as a server providing multi-user access to a number of databases....
    , PostgreSQL
    PostgreSQL

    PostgreSQL is an object-relational database management system . It is released under a BSD licenses and is thus free software. As with many other open-source programs, PostgreSQL is not controlled by any single company, but has a global community of developers and companies to develop it....
    , Oracle
    Oracle database

    The Oracle Database consists of a relational database management system produced and marketed by Oracle Corporation. , Oracle had become a major presence in database computing....
    , Ingres, SQLite
    SQLite

    SQLite is an ACID-compliant relational database management system contained in a relatively small C programming library .Unlike client-server database management systems, the SQLite engine is not a standalone process with which the program communicates....
     and Microsoft SQL Server
    Microsoft SQL Server

    Microsoft SQL Server is a relational database management system produced by Microsoft. Its primary query languages are SQL and Transact-SQL....
  • Google search
    Google

    Google Inc. is an United States public company, earning revenue from AdWords related to its Google search, Gmail, Google Maps, Google Apps, Orkut, and YouTube services as well as selling advertising-free versions of the Google Search Appliance....
    : LINQ to Google
  • Windows Search
    Windows Search

    Windows Search is an Search index desktop search platform released by Microsoft for the Microsoft Windows operating system. Windows Search for Windows Vista and Windows Server 2008 is a successor of the Windows Indexing Service, a remnant of the Object File System feature of the Cairo which never materialized....
    : LINQ to System Search
  • NHibernate
    NHibernate

    NHibernate is an Object-relational mapping solution for the .NET Framework platform: it provides a Software framework for mapping an Object-oriented programming domain model to a traditional relational database....
    : LINQ to NHibernate
    NHibernate

    NHibernate is an Object-relational mapping solution for the .NET Framework platform: it provides a Software framework for mapping an Object-oriented programming domain model to a traditional relational database....
  • OpenMapi: LINQ to MAPI
  • LLBLGen
    LLBLGen

    LLBLGen is a simple open source tool for Object-relational mapping in .NET Framework. Unlike many O/R mappers, LLBLGen works entirely through stored procedures; a Transact-SQL script is generated that defines a set of stored procedures when run, and the corresponding C Sharp layer only accesses the database through the generated procedures....
    : LINQ to LLBLGen
    LLBLGen

    LLBLGen is a simple open source tool for Object-relational mapping in .NET Framework. Unlike many O/R mappers, LLBLGen works entirely through stored procedures; a Transact-SQL script is generated that defines a set of stored procedures when run, and the corresponding C Sharp layer only accesses the database through the generated procedures....


Performance

Some benchmark on simple use cases tend to show that LINQ to Objects performance have a large overhead compared to normal operation.

LINQ to XML and LINQ to SQL performance compared to ADO.NET
ADO.NET

ADO.NET is a set of computer software components that can be used by programmers to access data and data services. It is a part of the base class library that is included with the .NET Framework....
 depend on the use case.

PLINQ

Microsoft, as a part of the Parallel FX Library
Parallel FX Library

Parallel Extensions to .NET, previously known as the Parallel Framework Extensions or , is a Managed code Concurrent programming Library being developed by a collaboration between Microsoft Research and the Common Language Runtime team at Microsoft....
, is developing PLINQ, or Parallel LINQ, a parallel
Parallel computing

Parallel computing is a form of computing in which many calculations are carried out simultaneously, operating on the principle that large problems can often be divided into smaller ones, which are then solved Concurrency ....
 execution engine for LINQ queries. It defines the IParallelEnumerable interface. If the source collection implements this interface, the parallel execution engine is invoked. The PLINQ engine executes a query in a distributed
Distributed computing

Distributed computing deals with hardware and software systems containing more than one processing element or Computer data storage element, Concurrent computing processes, or multiple programs, running under a loosely or tightly controlled regime....
 manner on a multi-core or multi-processor system.

Other language implementations

  • is Kai Jäger's JavaScript implementation of LINQ to Objects. Also provides a compiler that translates LINQ-style query expressions into JavaScript code.
  • Chris Pietschmann's is a LINQ implementation which extends JavaScript
    JavaScript

    JavaScript is a scripting language widely used for client-side web development. It was the originating Programming language dialect of the ECMAScript standard....
    's Array object with LINQ capabilities.
  • is Maarten Balliauw's PHP
    PHP

    PHP is a scripting language originally designed for producing dynamic web pages. It has evolved to include a command line interface capability and can be used in Standalone software Graphical user interface....
     implementation of LINQ.
  • is a Java
    Java (programming language)

    Java is a programming language originally developed by James Gosling at Sun Microsystems and released in 1995 as a core component of Sun Microsystems' Java ....
     implementation of LINQ.
  • is a typesafe Java
    Java (programming language)

    Java is a programming language originally developed by James Gosling at Sun Microsystems and released in 1995 as a core component of Sun Microsystems' Java ....
     implementation of LINQ.
  • a Java
    Java (programming language)

    Java is a programming language originally developed by James Gosling at Sun Microsystems and released in 1995 as a core component of Sun Microsystems' Java ....
     implementation of LINQ.
  • is a typesafe Java
    Java (programming language)

    Java is a programming language originally developed by James Gosling at Sun Microsystems and released in 1995 as a core component of Sun Microsystems' Java ....
     implementation of LINQ.


See also

  • Object-relational mapping
    Object-relational mapping

    Object-relational mapping is a Computer programming technique for converting data between incompatible type systems in relational databases and object-oriented programming languages....
  • Object-relational impedance mismatch
    Object-Relational impedance mismatch

    The object-relational impedance mismatch is a set of conceptual and technical difficulties that are often encountered when a relational database management system is being used by a program written in an object-oriented programming language or style; particularly when objects or class definitions are mapped in a straightforward way to databas...


External links