23.1. LINQ Providers

One of the key tenets of LINQ was the ability to abstract away the query syntax from the underlying data store. As you can see in Figure 23-1, LINQ sits below the various .NET languages such as C# and VB.NET. LINQ brings together various language features, such as extension methods, type inferences, anonymous types, and Lambda expressions, to provide a uniform syntax for querying data.

Figure 23.1. Figure 23-1

At the bottom of Figure 23-1 you can see that there are a number of LINQ-enabled data sources. Each data source has a LINQ provider that's capable of querying the corresponding data source. LINQ is not limited to just these data sources, and there are already providers available for querying all sorts of other data sources. For example, there is a LINQ provider for querying Sharepoint. In fact, the documentation that ships with Visual Studio 2008 includes a walk-through on creating your own LINQ provider.

In this chapter you'll see some of the standard LINQ query operations as they apply to standard .NET objects. Then in the following two chapters you'll see LINQ to XML, LINQ to SQL, and LINQ to Entities. As you will see, the syntax for querying the data remains constant, with only the underlying data source changing.

Get Professional Visual Studio® 2008 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.