INFO 344 Web Tools And Development CK Wang University of Washington Spring 2014
My favorite part of C# Open VS 2013, Console Project
What is LINQ? Why use it? LINQ (Lanugage-Integrated Query) Run SQL queries in C# data/objects Awesome for manipulating data
New Data Type Tuple <1,2,3,…> Store n objects in 1 object Anonymous class for n-properties, any type Super useful in LINQ
Basics Similar to SQL Select, Where, GroupBy, OrderBy Part 2 = how do I output in 1 line? Hint: Console.WriteLine(… linq …);
LINQ SelectMany = flattens the collection Take/Skip => partition operators ThenBy => order by, then by, … Ex: order by date, then by name
Others Other standard SQL stuff Count, Sum, Min, Max, Average Union, Intersect, Distinct
Reading http://msdn.microsoft.com/en-us/library/bb397926.aspx http://en.wikipedia.org/wiki/Language_Integrated_Query http://code.msdn.microsoft.com/101-LINQ-Samples-3fb9811b
Questions?