The document discusses the evolution of LINQ (Language Integrated Query) in .NET from version 1.0 through 3.5, including the introduction of lambda expressions and extension methods. It provides examples of LINQ queries on collections, joining data from multiple sources, and creating custom extension methods.
38. var slowQuery =
from c in customers
from p in purchases where c.ID == p.CustomerID
select c.Name + " bought a " + p.Description;
var fastQuery =
from c in customers
join p in purchases on c.ID equals p.CustomerID
select c.Name + " bought a " + p.Description;
39.
40. var easyToRead =
from c in customers
join p in purchases on c.ID equals p.CustomerID
select c.Name + " bought a " + p.Description;
var harderToRead = customers.Join (
purchases,
c => (int?)(c.ID),
p => p.CustomerID,
(c, p) => ((c.Name + " bought a ") +
p.Description)
);
C# 2 introduced generics, at that point, C# is feature complete for OO features
Next challenge to tackle after OO features is Big Data, how to reduce complexity of integrating information
Provide translation between database constructs and objects
Easy way to query data sourceExtension methods, query comprehension syntaxWay to return arbitrary resultsAnonymous types,var keywordWay to pass input dataClosures, collection and object initializers