Summary
In this chapter, we have learned new features related to LINQ including the new data type, var
, object and collection initializers, extension methods, lambda expressions, LINQ syntax, and query expressions. Now that we have the required knowledge for LINQ, we are ready to try LINQ to Entities, which will be discussed in the next chapters.
The key points covered in this chapter include:
The new data type,
var,
gives extra flexibility when defining new variablesThe Automatic Property feature can be used to define simple properties
Initial values can be assigned to a new object and collection variables by using Object initializer and Collection initializer
Actual types will be created for anonymous types at compile time
Extension methods can be used to extend the public contract of an existing CLR type without having to subclass or recompile the original type
Lambda expression is just another way of writing anonymous methods in a more concise and functional syntax
Many LINQ-specific extension...