LINQ Programming with C# 3.0


Description 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.

This course requires proficiency in the C# language and general ADO.NET technologies. Classes available to satisfy these requirements include: • C# 3.0 Programming

Learning Objectives
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 o Logging o Changing the connection string 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