LINQ Unleashed: for C#

LINQ Unleashed: for C#

by Paul Kimmel
     
 

View All Available Formats & Editions

Foreword by Darryl Hogan, Architect Evangelist, Microsoft Corporation

 

Microsoft’s highly anticipated LINQ query technology makes it easy to retrieve any information programmatically from any data source, no matter where it comes from or how it’s stored. Using LINQ, developers can query objects, relational

See more details below

Overview

Foreword by Darryl Hogan, Architect Evangelist, Microsoft Corporation

 

Microsoft’s highly anticipated LINQ query technology makes it easy to retrieve any information programmatically from any data source, no matter where it comes from or how it’s stored. Using LINQ, developers can query objects, relational databases, XML documents, and ADO.NET datasets--and do it all directly from C# 3.0, leveraging the powerful capabilities of LINQ.

 

This is a definitive guide to getting real-world results with LINQ, using C# 3.0 and Visual Studio 2008. In LINQ Unleashed, Microsoft MVP Paul Kimmel covers every facet of LINQ programming, showing how LINQ can help you dramatically improve your productivity and build more reliable, maintainable applications.

 

Kimmel begins by reviewing the state-of-the-art C# programming techniques LINQ uses, including anonymous types, partial methods, and Lambda expressions. Next, using realistic examples and easy-to-adapt sample code, he details the most powerful new LINQ techniques for accessing objects, databases, and XML. You’ll gain a deep and practical understanding of how LINQ works “under the hood”--and learn how to do everything from selecting data through integrating XML with other data models.

 

  • Build efficient LINQ queries to .NET objects, SQL databases, and XML content
  • Utilize anonymous types to reduce design time, coding effort, and debugging time
  • Automatically generate .NET state machines with the new yield return construct
  • Master LINQ query syntax, operators, extension methods, sorting, grouping, aggregate and set operations, and more
  • Make the most of select--and use it in the business layer of your n-tier applications
  • Query relational data stored in Microsoft SQL Server
  • Use nullable types to eliminate unnecessary database access plumbing code
  • Use LINQ with ADO.NET 3.0 and Microsoft’s powerful new Entity Framework
  • Extract XML data without the hassles or complexity of XPath
  • Automatically construct XML from CSV files and other non-XML data
  • Query Active Directory by extending LINQ

Read More

Product Details

ISBN-13:
9780768685374
Publisher:
Pearson Education
Publication date:
08/19/2008
Series:
Unleashed
Sold by:
Barnes & Noble
Format:
NOOK Book
Pages:
552
File size:
4 MB

Read an Excerpt

IntroductionIntroduction

By the time you are holding this book in your hands, I will have 30 years in since the first time I wrote some code. That code was ROM-BASIC on a TRS-80 in Washington grammar school in Owosso, Michigan, and I was in the fifth grade. Making the "tank" slide back and forth shooting blips across the screen was neat. Changing the code to change blip speeds and numbers of targets was exhilarating. Three decades later and I get more excited each passing year. There are great technologies on the horizon like Microsoft Surface, Popfly, and LINQ. This book is about LINQ, or Language INtegrated Query.

LINQ is a SQL-like language for C#. When I first saw it, I didn't like it. My first impression was that someone had glommed on a bastardization of C# and it was ugly like SQL can get. I didn't like it because I didn't understand it. However, I gave LINQ a second chance (as I want you to do) and discovered that LINQ is thoroughly integrated, tremendously powerful, and almost as much fun as a Tesla Roadster or doing hammerheads in an Extra 300L.

The query capabilities of LINQ are extended to objects, SQL, DataSets,

LINQ and its underpinnings are powerful and challenging, and in this book you will get what you need to know to completely understand all that makes LINQ work and begin using it immediately. You will learn about anonymous methods, extension methods, Lambda Expressions, state machines, how generics and the CodeDOM play a big role in powerful tools like LINQ, and writing LINQ queries and why you will want to do it in the bigger, grander scheme of things. You will also learn how to save a ton of time and effort by nothard-coding those elements that you will no longer need or want to hard-code, and you will have a better grasp of how LINQ fits into n-tier architectures without breaking guidelines that have helped you succeed to date.

Brought to you by a four-time Microsoft MVP and columnist for over a decade, LINQ Unleashed for C# will teach you everything you need to know about LINQ and .NET 3.5 features and how to be more productive and have more fun than ever before.Conventions Used in This Book

The following typographic conventions are used in this book:

Code lines, commands, statements, variables, and text you see onscreen appear in a monospace typeface.

Occasionally in listings bold is used to draw attention to the snippet of code being discussed.

Placeholders in syntax descriptions appear in an italic monospace typeface. You replace the placeholder with the actual filename, parameter, or whatever element it represents.

Italics highlight technical terms when they're being defined.

A code-continuation icon is used before a line of code that is really a continuation of the preceding line. Sometimes a line of code is too long to fit as a single line on the page. If you see before a line of code, remember that it's part of the line immediately above it.

The book also contains Notes, Tips, and Cautions to help you spot important or useful information more quickly.

© Copyright Pearson Education. All rights reserved.

Read More

Customer Reviews

Average Review:

Write a Review

and post it to your social network

     

Most Helpful Customer Reviews

See all customer reviews >