|
Linq is a technology – being added to the .NET Framework – that will change your programming life. Linq is designed to seamlessly integrate data query features into programming languages like C#, eliminating the disconnection between traditional programming languages on the one hand, and query technologies like SQL and XQuery on the other. But Linq doesn’t just let you access data in databases or structured documents: you can use it to query data from virtually any data source – including .NET collections and sequences that implement IEnumerable<T>. And Linq goes further by letting you build, manage and express queries as objects which adhere to contemporary OO principles. And while a shallow appraisal of Linq may make you think it’s only for data access, you can actually apply it to any tier of your application, from client to middle-tier, as well as the data-access layer.
In this subset of our 5-day LINQ/.NET 3.5 BootCamp, you’ll get an outstanding exposure to the fundamentals of Linq and C# 3.0.
We’ll start by jumping right into building Linq queries: Selecting, Filtering, Ordering and Grouping. With these and more powerful queries (joining, sub-selects and data transformations), you’ll quickly get the idea of how to use Linq using C# 3.0. We’ll also discuss how Linq queries – based on the custom iterators introduced with C# 2.0 – leverage deferred execution so that you don’t incur the overhead of query until you consume it. We’ll also take a quick look at output options: how to emit query results as XML or output to a database.
Next, we’ll look at the role of C# 3.0, and how the new features in 3.0 evolved from 2.0. You’ll learn the new initialization techniques available, and how to “new up” anonymous types on-demand. We’ll take a detailed look at extension methods and how they’re both implicitly and explicitly used in Linq Queries, but also how you can use them in day-to-day .NET development. And we’ll delve into Lambda Expressions, a new way of creating anonymous methods, but easier to read and write. We’ll wrap up our C# 3.0 section with auto-implemented properties and partial methods.
The next section will let us explore how Linq is applied to real-world scenarios: querying and updating data from disparate sources like SQL databases, typed and untyped ADO.NET DataSets, and XML documents. We’ll look at lots of fine details: how to use Linq to SQL (formerly known as DLinq) to query and update multiple tables; how to use Linq with existing typed/untyped DataSets – and when you should/shouldn’t; how the VS2008 toolset will make so much of this child’s play to get work done. We’ll also examine Linq to XML, and you’ll see how you can easily use it in place of – and along side of – existing code that accesses and updates XML documents. You’ll see how you can quickly and easily serialize and de-serialize entire object graphs to and from XML documents cleanly – in a version-independent fashion – without the crud normally inserted by traditional .NET serialization.
Finally, we’ll wrap-up with a behind-the-scenes look: what goes on when you create query expressions, how they work, and how .NET Framework 3.5 has been extended to include an entire sub-framework of methods and classes to support Linq. We’ll also look at how you can build expressions and queries dynamically to address query needs only known at runtime.
Pre-requisites: to attend this course, you should have a minimum of 2+ years experience programming C# and the .NET Framework, and 1+ year programming C# 2.0, or you should have attended the .NET BootCamp. (Sorry, no hand-holding if you’re new to .NET/C#.)
|