Monday, January 07, 2008

LINQ to TerraServer

Charlie Calvert's Community Blog - TerraServer Sample: A LINQ Provider

"Over the holidays Alex Turner, Mary Deyo and I added a new sample to the downloadable version of the CSharp samples that accompany Visual Studio 2008. This sample is called the LinqToTerraServerProvider, and it appears in a sub-directory called WebServiceLinqProvider. The LINQ provider technology that makes this sample possible is also used by other tools such as LINQ to Amazon, LINQ to LDAP, LINQ to SharePoint, and LINQ to Google Desktop.

...

The TerraServer example shows how to create a LINQ provider. The provider technology makes it possible for your to extend LINQ to enable querying a new data source. For instance, LINQ ships with the ability to query SQL servers, XML files and generic objects. The LINQ provider technology allows you to extend LINQ so you can query a new data source such as a text file or a web site. This particular sample shows how to write a provider that makes it possible for LINQ developers to query the web service provided by the TerraServer mapping and aerial photography web site.

The following query from the sample will return a list of states in the US that have a city, town or some other location called Redmond:

var query1 = from place in terraPlaces
where place.Name== "Redmond"
select place.State;


..."




This is kind of like "LINQ to World"?  ;)

No comments: