什么是LINQ提供程序?程序、LINQ

2023-09-04 12:33:09 作者:锤死凹特曼

什么是LINQ提供程序,而其目的是什么?

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

推荐答案

一个LINQ提供程序是一种软件,实现了 IQueryProvider 的IQueryable 为特定的数据存储接口。换句话说,它可以让你编写针对该数据存储的LINQ查询。例如,LINQ到XML支持,您可以编写针对XML文档的LINQ查询。

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.

请参阅 http://dotnetslackers.com/articles/csharp/LINQProviderBasics.aspx

您也可以编写自己的LINQ提供程序,虽然它不是小事。请参阅建立一个IQueryable提供商和演练:创建IQueryable的LINQ提供了解详情。

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.