NewEra Technology Facebook
50066A: LINQ with C# 3.0 - Course Information
PRINT
SEND TO A FRIEND
Name: 50066A: LINQ with C# 3.0
Category: Microsoft Official Curriculum Courses
Length (Days): 3
Course Price (CAD): 1385
Description:
About this Course
This three-day instructor-led course provides students with the knowledge and skills to develop applications with the C# 3.0 language and the LINQ (Language Integrated Query) framework.

LINQ is Microsoft’s framework for bridging the gap between various data sources and the .NET object-oriented languages. LINQ abstracts away the data source, providing an intuitive, declarative and uniform query interface to object collections, SQL-based relational databases and XML documents. Its extensibility features facilitate integrating additional data sources through the use of custom query providers. LINQ C# integration relies heavily on a set of new features of the C# 3.0 language.
The course is packed with practical code samples, demos and exercises to facilitate understanding the motivation of LINQ, the design patterns for its application, and its potential pitfalls.

Audience Profile
This course is intended for C# developers with practical experience of at least a year with the .NET framework.

At Course Completion
After completing this course, students will be able to:
• Apply the new C# 3.0 language features in appropriate and practical scenarios.
• Apply the LINQ framework for accessing various types of data sources.
• Extend LINQ by customizing data sources through query operators, with an eye towards custom LINQ providers.
• Understand the LINQ product road-map for future frameworks including ADO.NET Data Services, ADO.NET Entity Framework and Parallel LINQ.
• Implement LINQ applications with a performance-oriented mindset.
Prerequisites:
Before attending this course, students must have:
• Working knowledge of C# 2.0: Generics, Anonymous methods, Iterators.
• Working knowledge of the .NET Framework 2.0: Collection classes, ADO.NET, XML DOM.
- or -
• -Completed course 2349 or have equivalent knowledge in the above topics.
Outline:
Module 1: C# 3.0 Language Features
This module explains how to apply C# 3.0 language features in real applications, and provides the motivation for each feature, categorizing them into four distinct groups: Developer productivity features, Extensibility features, Functional programming features and LINQ support features.
Lessons
• Developer Productivity Features – Implicit typing, Object and collection initializers, Automatic properties, Anonymous types
• Extensibility Features – Extension methods, Partial methods
• Functional Programming Features – Lambda expressions, Expression trees
• LINQ Support Features – An overview of language query operators

Lab : Extension Methods and IEnumerable
• ForEach extension method for IEnumerable
• MaxElement extension method for IEnumerable

Lab : Extension Methods and Anonymous Types
• Extension method for turning anonymous types into tuples

After completing this module, students will be able to:
• Extend existing types using extension methods.
• Use lambda expressions and expression trees for simple functions.
• Initialize collections and objects and use automatic properties and anonymous types to facilitate productivity.

Module 2: LINQ Query Operators
This module explains how to use LINQ query operators to perform a variety of operations on an abstract enumerable data source in a declarative fashion.
Lessons
• Motivation for Query Operators – Declarative vs. Imperative programming
• Developing Query Operators – C# 2.0 Iterators, Deferred execution
• Categorizing Query Operators – Filtering, aggregation, ordering, grouping, projection, and miscellaneous operators
• Language Integration of Query Operators

Lab : Implementing Query Operators
• Implementing LastOrDefault, Cast, Concat, and Aggregate

After completing this module, students will be able to:
• Use query operators in declarative code instead of imperative loops and transformations.
• Develop custom query operators to extend the existing framework.

Module 3: Applied LINQ to Objects
This module explains how to use language query operators with arbitrary objects (Reflection API, File System, Strings etc.) and how to customize the query behavior for specific types.
Lessons
• Using Query Operators with Objects
• Customizing Query Operators
• The Query Pattern
• Examples of LINQ to Objects – Reflection, File System, Strings, WCF Contracts

Lab : Implementing the Query Pattern
• Implementing the query pattern for the DataTable class

Lab : Using LINQ Queries
• Using LINQ to query the file system
• Using LINQ to query the .NET Reflection API

After completing this module, students will be able to:
• Use language-integrated query operators with arbitrary types and understand the limitations imposed on these types.
• Customize the query behavior for specific types using the query pattern.

Module 4: LINQ to XMLThis module explains how to use the now familiar LINQ operators to query XML documents using the new XElement API.
Lessons
• Introducing the XElement API
• Functional XElement Construction
• Querying XElement DOMs
• Axis Methods

Lab : LINQ to XML
• XML query and transform using LINQ
• XML query and aggregation using LINQ to XML and LINQ to Objects

After completing this module, students will be able to:
• Use LINQ operators to query XML documents with the new XElement API.
• Construct XElement document fragments.

Module 5: LINQ to SQL
This module explains how to use LINQ to SQL as an object-relational mapper and perform sophisticated queries with object management, transactions and other database features using the language query operators.
Lessons
• LINQ to DataSet – Why DataSets are not enough
• LINQ to SQL as an Object-Relational Mapper – Mapping using attributes, mapping using external XML mapping files, mapping inheritance relationships
• The Data Context – Queries, updates, inserts, deletes, stored procedures and database functions, custom SQL strings, database creation from schema, transactions, preloading and tracking data, optimistic locking and concurrency control
• Visual Studio LINQ to SQL Designer vs. SQLMetal

Lab : Integrating XML Mapping
• Constructing a DataContext from embedded XML mapping files

Lab : Testing Concurrency Control and Object Tracking
• Transactional work and concurrency control
• Non-transactional work and conflict management
• Object tracking and identity management

Lab : Inheritance Mapping
• Mapping a hierarchy using attributes
• Creating a database from schema

After completing this module, students will be able to:
• Map CLR types to database tables using LINQ to SQL through attributes or XML mapping files.
• Perform CRUD operations on a relational data source.
• Manage concurrency control and object tracking scenarios.
• Use the Visual Studio designer and the SQLMetal tool for generating mappings from a database schema.

Module 6: Beyond LINQ
This module explains how to prepare for the upcoming technologies in the LINQ framework and how to maximize performance of LINQ applications.
Lessons
• Overview of Parallel LINQ
• Overview of ADO.NET Entity Framework
• Overview of ADO.NET Data Services
• Overview of Custom Query Providers
• Performance Considerations of LINQ to Objects
• Performance Considerations of LINQ to XML
• Performance Considerations of LINQ to SQL

After completing this module, students will be able to:
• Understand the Microsoft road-map in the LINQ product line.
• Implement LINQ applications with a performance-oriented mindset.
Guaranteed to run courses