LINQ Programming with C# 3.0

3 Day Instructor-Led Onsite or Online Course

Course Summary:

Language Integrated Query (LINQ) provides a revolutionary way to query and interact with objects, XML and databases. In this course you’ll be immersed in LINQ technologies and learn how to LINQ and lambda syntax along with C# 3.0 language features to increase productivity, write less code and more easily access the data your applications need. Topics covered include C# 3.0 language features, lambda expressions, LINQ to Objects, LINQ to DataSets, LINQ to XML, LINQ to SQL and LINQ to Entities. You’ll leave the course with a thorough understanding of how LINQ and its related technologies can be used in your company’s applications to increase overall productivity and simplify future maintenance.

Video Introduction:

Get Microsoft Silverlight

Click the icon to switch to full-screen mode. Click here to view in MP4 format.

Pre-Requisites:

This course requires proficiency in the C# language and general ADO.NET technologies.

What You'll Learn:
  • How to write code more productively
  • How to query and filter object collections using LINQ
  • The role of extension methods
  • Lambda expression syntax
  • How to use LINQ to query and filter DataSets
  • How to call stored procedures with minimal code
  • How to map database objects to C# objects
  • The role of the Entity Framework
  • Pros and Cons of LINQ to SQL and the Entity Framework

Course Details:

Introduction to LINQ
  • What is LINQ?
  • What problems does LINQ solve?
  • LINQ Technologies
  • LINQ assemblies and namespaces
  • Query operators and expressions
  • Writing your first LINQ query
  • LINQ learning tools
C# 3.0 Language Features
  • Implicitly typed local variables
  • Extension methods
  • Default properties
  • Object initialization
  • Array initialization
  • Anonymous types
  • Lambda expressions
LINQ to Objects
  • What is LINQ to Objects?
  • Selecting data from collections
  • Projecting data with anonymous types
  • Filtering data from collections
  • Performing join operations
  • Grouping data
  • Sorting data
  • Aggregating data
  • Selecting distinct objects
Lambda Expressions
  • Understanding lambda expressions
  • The relationship between delegates and lambdas
  • The System.Func delegate
  • Key extension methods
  • Working with Lambda Expressions
LINQ to DataSets
  • What is LINQ to DataSets?
  • Key LINQ to DataSets classes
  • Selecting data from a DataTable
  • Joining DataTables
  • Sorting data from DataTables
  • Working with typed DataSets
  • Using lambda expressions to query DataTables
Getting Started with LINQ to SQL
  • What is LINQ to SQL?
  • Key LINQ to SQL classes
  • Deferred loading versus immediate loading
  • Creating LINQ to SQL entity classes
  • Entity class attributes
  • Creating relationships with EntitySet
  • Using the LINQ to SQL Designer
  • The role of the data context object
  • Selecting, updating, deleting and inserting data
  • Creating a base data context object
Additional LINQ to SQL Features
  • Including child objects in a LINQ to SQL query
  • Attaching objects to the data context
  • Calling stored procedures
  • Executing dynamic SQL queries
  • Managing concurrency issues
  • Managing transactions
  • Mapping custom POCO classes to SQL objects
  • Generating entities using sqlmetal.exe
LINQ to XML
  • What is LINQ to XML?
  • Key LINQ to XML classes
  • Querying XML and mapping data to custom objects
  • Editing and saving XML documents
  • Querying LINQ to XML objects with XPath
  • Transforming XML to other formats
  • Converting flat-files to XML
LINQ to Entities and the Entity Framework
  • What is the Entity Framework?
  • Comparing Entity Framework with LINQ to SQL
  • Key Entity Framework classes
  • Understanding entity data model parts (CSDL, SSDL, MSL)
  • Creating an entity data model in Visual Studio
  • Querying an entity data model with LINQ to Entities
  • Mapping stored procedures to entities
  • Using lambda expressions to query a data model
  • Creating entity SQL queries
  • Using parameters in entity SQL queries

Contact Us for information about onsite or online courses.

Video Tips Newsletter for .NET and SharePoint Developers
Sign-up to receive our free video tips newsletter for .NET and SharePoint developers and learn about technologies that can help make you more productive: