Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is a LINQ provider? [closed]

Tags:

.net

linq

What is a "LINQ provider," and what is its purpose?

like image 458
user366312 Avatar asked Oct 14 '09 18:10

user366312


2 Answers

A linq provider is software that implements the IQueryProvider and IQueryable interfaces for a particular data store. In other words, it allows you to write Linq queries against that data store. For example, the Linq to XML provider allows you to write Linq queries against XML documents.

See http://dotnetslackers.com/articles/csharp/LINQProviderBasics.aspx

You can also write your own Linq provider, although it is not trivial. See Building an Iqueryable Provider and Walkthrough: Creating an IQueryable LINQ Provider for more information.

like image 74
Robert Harvey Avatar answered Oct 20 '22 12:10

Robert Harvey


"LINQ (Language Integrated Query) works as a middle tier between data store and the language environment. From a developer's point of view, it is just a new pattern for querying data from multiple data structures directly in the IDE. Behind the scenes it does a whole lot of tasks like expression processing, validation and calling the right routine to fetch data or build a query to run in SQL Server. In short, LINQ stands as common query gateway between the language and the data store." http://dotnetslackers.com/articles/csharp/LINQProviderBasics.aspx

A particular gateway for a particular data store (e.g. xml files, sql rdmbs) is called a LINQ Provider. It is realised by implementing the IQueryable Interface.

Matt Waren has a great tutorial series on implementing a cusotm linq provider.

like image 29
Johannes Rudolph Avatar answered Oct 20 '22 12:10

Johannes Rudolph