Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Visual Studio 2008 Training 3.5 RTM Mohamed Saleh [email_address] www.jordev.net www.geeksconnected.com/mohamed
Module 3:  Introduction To Linq
Overview   <ul><li>What is Linq </li></ul><ul><li>Understand the Query Expressions and Query Operators </li></ul><ul><li>W...
Introducing LINQ Project <ul><li>Linq is a set of language extensions that enable the query operations over the data. </li...
LINQ Assemblies <ul><li>The following describes the new assemblies and its use: </li></ul><ul><li>System.Core.dll: Extensi...
LINQ Query Expressions <ul><li>What is Query? </li></ul><ul><li>What is Query Operators? </li></ul><ul><li>How to Write Qu...
Lab 1:  Writing Query Expressions <ul><li>Writing Linq Query Expression. </li></ul><ul><li>Using Query Operators. </li></u...
Standard Query Operators <ul><li>The System.Linq namespace contains different Linq Extensions under the System.Linq.Enumer...
Lab 2:  Using Initializers <ul><li>Writing Queries using Linq Extension Methods. </li></ul><ul><li>Sorting the elements us...
Conversion Operators <ul><li>The conversion operator enable the conversion of query results into different collection type...
Lab 3:  Using Conversion Operators <ul><li>Enforce the immediate execution of the queries. </li></ul><ul><li>Converting th...
Partitioning Operators <ul><li>Linq extension methods set contain a group of operators that allows the programmer to parti...
Lab 4:  Using Partitioning Operators <ul><li>Use the partitioning query operators. </li></ul><ul><li>Skipping elements bas...
LINQ Bridge <ul><li>LINQ Implemented for .NET 3.5, which requires the client to install .NET Framework 3.5. </li></ul><ul>...
Lab 5:  Using LINQ for .NET Framework 2.0 <ul><li>Writing Linq-Enabled Applications for .NET Framework 2.0. </li></ul><ul>...
Review In this module, you learned to: <ul><li>Writing Query Expressions </li></ul><ul><li>Writing Queries using extension...
Upcoming SlideShare
Loading in …5
×

Module 3: Introduction to LINQ (PowerPoint Slides)

5,851 views

Published on

Module 3: Introduction to LINQ (PowerPoint Slides)
Jordan .NET User Group (Jordev)
Community Material
Mohamed Saleh

Published in: Technology
  • 4str
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

Module 3: Introduction to LINQ (PowerPoint Slides)

  1. 1. Visual Studio 2008 Training 3.5 RTM Mohamed Saleh [email_address] www.jordev.net www.geeksconnected.com/mohamed
  2. 2. Module 3: Introduction To Linq
  3. 3. Overview <ul><li>What is Linq </li></ul><ul><li>Understand the Query Expressions and Query Operators </li></ul><ul><li>Writing queries using extension methods </li></ul><ul><li>Using the Partitioning and Conversion operators </li></ul><ul><li>Explain the usage of the new Linq Assemblies </li></ul><ul><li>Enabling Linq to Objects for .Net Framework 2.0 </li></ul>
  4. 4. Introducing LINQ Project <ul><li>Linq is a set of language extensions that enable the query operations over the data. </li></ul><ul><li>Linq relies on the C# 3.0 Language Enhancements . </li></ul><ul><li>Linq Building Blocks: </li></ul><ul><ul><ul><ul><ul><li>Object Initializers </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>Lambda Expressions </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>Extension Methods </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>Anonymous types </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>Implicit Typing Variables </li></ul></ul></ul></ul></ul>LINQ Project Overview
  5. 5. LINQ Assemblies <ul><li>The following describes the new assemblies and its use: </li></ul><ul><li>System.Core.dll: Extension Methods for IEnumerable<T> . </li></ul><ul><li>System.Data.DataExtensions.dll: Providing LINQ for DataSet. </li></ul><ul><li>System.Data.Linq.dll: LINQ implementation for SQL Server. </li></ul><ul><li>System.Xml.Linq.dll: LINQ Implementation for XML </li></ul>LINQ Assemblies
  6. 6. LINQ Query Expressions <ul><li>What is Query? </li></ul><ul><li>What is Query Operators? </li></ul><ul><li>How to Write Query Expressions? </li></ul><ul><li>IEnumerable<T> and Query Results </li></ul><ul><li>What is Deferred Execution? </li></ul><ul><li>What is Immediate Execution? </li></ul>LINQ Query Expressions
  7. 7. Lab 1: Writing Query Expressions <ul><li>Writing Linq Query Expression. </li></ul><ul><li>Using Query Operators. </li></ul><ul><li>Using var and IEnumerable<T> query varaiables. </li></ul><ul><li>Querying In-Memory Collections. </li></ul>
  8. 8. Standard Query Operators <ul><li>The System.Linq namespace contains different Linq Extensions under the System.Linq.Enumerable class. </li></ul><ul><li>Commonly Used Operators: </li></ul><ul><li>OrderByDescending </li></ul><ul><li>OrderBy </li></ul><ul><li>Take </li></ul><ul><li>Sum </li></ul><ul><li>Distinct </li></ul><ul><li>Count </li></ul><ul><li>First </li></ul>Standard Query Operators Overview
  9. 9. Lab 2: Using Initializers <ul><li>Writing Queries using Linq Extension Methods. </li></ul><ul><li>Sorting the elements using the OrderByDescending extension method. </li></ul><ul><li>Returning specific elements using Take and First methods. </li></ul><ul><li>Calculating the total number of elements using the Count method. </li></ul><ul><li>Returning Distinct values from a sequence of values. </li></ul>
  10. 10. Conversion Operators <ul><li>The conversion operator enable the conversion of query results into different collection types. </li></ul><ul><li>The query conversion operators: </li></ul><ul><ul><li>ToArray </li></ul></ul><ul><ul><li>ToList </li></ul></ul><ul><ul><li>ToDictionary </li></ul></ul><ul><ul><li>OfType </li></ul></ul>Conversion Operators Overview
  11. 11. Lab 3: Using Conversion Operators <ul><li>Enforce the immediate execution of the queries. </li></ul><ul><li>Converting the query results to Different Collection Types. </li></ul><ul><li>Filtering the query results based on a specific data type. </li></ul>
  12. 12. Partitioning Operators <ul><li>Linq extension methods set contain a group of operators that allows the programmer to partitioning the results of the query into a specific sequence. </li></ul><ul><li>The query partitioning operators: </li></ul><ul><ul><li>Take </li></ul></ul><ul><ul><li>Skip </li></ul></ul><ul><ul><li>TakeWhile </li></ul></ul><ul><ul><li>SkipWhile </li></ul></ul>Partitioning Operators Overview
  13. 13. Lab 4: Using Partitioning Operators <ul><li>Use the partitioning query operators. </li></ul><ul><li>Skipping elements based on conditional expression. </li></ul><ul><li>Retrieving elements using Take and TakeWhile operators. </li></ul>
  14. 14. LINQ Bridge <ul><li>LINQ Implemented for .NET 3.5, which requires the client to install .NET Framework 3.5. </li></ul><ul><li>LINQBridge is an open project contains a reimplementation for all standard query operators </li></ul><ul><li>LINQBridge utilize the Csharp 3.0 Compiler new features to enable LINQ for .NET 2.0 Applications. </li></ul><ul><li>LINQBridge can be used in Visual Studio 2008 for writing LINQ to Objects expressions. </li></ul><ul><li>LINQBridge can be used in Visual Studio 2005 using the extension methods style. </li></ul>LINQ Bridge Overview
  15. 15. Lab 5: Using LINQ for .NET Framework 2.0 <ul><li>Writing Linq-Enabled Applications for .NET Framework 2.0. </li></ul><ul><li>Using the LinqBridge Extension in Visual Studio 2008. </li></ul><ul><li>Writing Linq to Objects expressions. </li></ul>
  16. 16. Review In this module, you learned to: <ul><li>Writing Query Expressions </li></ul><ul><li>Writing Queries using extension methods directly </li></ul><ul><li>Using different query operators </li></ul><ul><li>Enabling Linq to Objects into .NET Framework 2.0 Applications </li></ul>

×