Essential LINQ

Essential LINQ

Essential LINQ

Essential LINQ

eBook

$31.49  $41.39 Save 24% Current price is $31.49, Original price is $41.39. You Save 24%.

Available on Compatible NOOK Devices and the free NOOK Apps.
WANT A NOOK?  Explore Now

Related collections and offers


Overview

“Charlie and Dinesh bring important skills to this project that enable them to show how LINQ works and the practical ways you can use it in your daily development process.”

From the Foreword by Anders Hejlsberg

 

LINQ is one of Microsoft’s most exciting, powerful new development technologies. Essential LINQ is the first LINQ book written by leading members of Microsoft’s LINQ and C# teams. Writing for architects, developers, and development managers, these Microsoft insiders share their intimate understanding of LINQ, revealing new patterns and best practices for getting the most out of it.

 

Calvert and Kulkarni begin by clearly explaining how LINQ resolves the long-time “impedance mismatch” between object-oriented code and relational databases. Next, they show how LINQ integrates querying into C# as a “first-class citizen.” Using realistic code examples, they show how LINQ provides a strongly typed, IntelliSense-aware technology for working with data from any source, including SQL databases, XML files, and generic data structures.

 

Calvert and Kulkarni carefully explain LINQ’s transformative, composable, and declarative capabilities. By fully illuminating these three concepts, the authors allow developers to discover LINQ’s full power. In addition to covering core concepts and hands-on LINQ development in C# with LINQ to Objects, LINQ to XML, LINQ to SQL, and LINQ to Entities, they also present advanced topics and new LINQ implementations developed by the LINQ community. This book

 

•           Explains the entire lifecycle of a LINQ project: design, development, debugging, and much more

•           Teaches LINQ from both a practical and theoretical perspective

•           Leverages C# language features that simplify LINQ development

•           Offers developers powerful LINQ query expressions to perform virtually any data-related task

•           Teaches how to query SQL databases for objects and how to modify those objects

•           Demonstrates effective use stored procedures and database functions with LINQ

•           Shows how to add business logic that reflects the specific requirements of your organization

•           Teaches developers to create, query, and transform XML data with LINQ

•           Shows how to transform object, relational, and XML data between each other

•           Offers best patterns and practices for writing robust, easy-to-maintain LINQ code


Product Details

ISBN-13: 9780321604224
Publisher: Pearson Education
Publication date: 03/12/2009
Series: Microsoft Windows Development Series
Sold by: Barnes & Noble
Format: eBook
Pages: 600
File size: 6 MB

About the Author

Charlie Calvert, Community Program Manager for the Microsoft C# team, currently focuses his technical energies on LINQ. He has periodically worked with LINQ Chief Architect Anders Hejlsberg both during the development of Delphi and during the development of LINQ. Calvert’s ten technical books have sold more than 100,000 copies. They include Delphi 4 Unleashed, C++Builder 3 Unleashed, Delphi 2 Unleashed, Teach Yourself Windows 95 Programming in 21 Days, and Teach Yourself Windows Programming.

 

Dinesh Kulkarni is a Senior Program Manager on Microsoft’s .NET Framework team. He was the Program Manager in charge of LINQ to SQL. He was deeply involved in LINQ’s planning and implementation from the incubation stage and was lead author for MSDN’s authoritative LINQ to SQL paper. Before joining Microsoft, he worked in diverse technical roles ranging from architecting and implementing front-end CASE tools for IBM to designing databases and middleware for a Wall Street hedge fund.

Table of Contents

Foreword  xxi

Acknowledgments  xxv

About the Authors  xxix

Chapter 1        Introduction  1

Chapter 2        Getting Started  13

Chapter 3        The Essence of LINQ  39

Chapter 4        C# 3.0 Technical Overview  65

Chapter 5        Writing Query Expressions  129

Chapter 6        Query Operators  175

Chapter 7        A Quick Tour of LINQ to SQL  231

Chapter 8        Reading Objects with LINQ to SQL  247

Chapter 9        Modifying Objects with LINQ to SQL  281

Chapter 10      Using Stored Procedures and Database Functions with LINQ to SQL  319

Chapter 11      Customizing Entity Persistence and Adding Business Logic  337

Chapter 12      LINQ to Entities Overview  349

Chapter 13      LINQ to XML: Creation  369

Chapter 14      Querying and Editing XML  387

Chapter 15      XML Namespaces, Transforms, and Schema Validation  423

Chapter 16      Introduction to LINQ Patterns and Practices  465

Chapter 17      LINQ Everywhere  487

Chapter 18      Conclusion  515

Appendix A    Tips for Developers  519

Index  547

Preface

ForewordForeword

For years I have been fascinated with the differences between general-purpose programming languages and databases. Practically every enterprise application built today is coded in a general-purpose programming language and talks to a database, yet the two ecosystems are amazingly different and quite poorly integrated—the impedance mismatch between object-oriented programming and the relational model is the gift that keeps on giving when it comes to application complexity.

But the thing I find particularly puzzling is the lack of query capabilities in general-purpose programming languages. Why is it you can query database tables but not in-memory objects? Why are XPath and XQuery so arbitrarily different from SQL? Why is it so hard to transform data between the object, relational, and XML domains? These are the kinds of questions that launched us on the Language Integrated Query (LINQ) journey. Along the way we got wise to the wonders of functional programming, lambda expressions, type inference, monads, O/R mapping, and all sorts of fascinating computer science. Fortunately, we managed to boil our learnings down to a set of pragmatic language features and APIs that are useful in practically any .NET application.

LINQ extends the .NET Framework and programming languages with a uniform model for querying and transforming in-memory collections, relational data, and XML documents. With LINQ, C# 3.0 and VB 9.0 gain the expressive power of SQL and XQuery to become the first general-purpose programming languages to natively support queries and transformations over all classes of data.

LINQ was a very interesting and unique project to workon. One reason is that it wasn’t just about language features. In order to gain experience with the query capabilities we were developing, we needed to validate them against the important data domains—objects, relational, and XML. That led us to create the LINQ to Objects, LINQ to SQL, and LINQ to XML APIs, all of which were built alongside the language features. The synergy and agility we got from having a joint team working on both language and APIs was just amazing—and loads of fun!

Also, LINQ isn’t just a single monolithic language feature, but rather a collection of several smaller and individually useful features—such as lambda expressions, extension methods, expression trees, object initializers, and anonymous types—that all come together to form the concept of Language Integrated Query. This made our work much more relevant and leveraged.

Finally, LINQ is big step toward a more declarative style of programming. This may be subtle, but it is really important. Programs written in today’s imperative programming languages are too much about the “how” and too little about the “what.” We tend to over-specify the solutions to our programming problems—for example, by deconstructing queries into for loops, if statements, manipulation of temporary collections, and so on. By the time such programs run, it is all but impossible for the execution environment to “understand” what they do. The higher level semantic meaning has been lost in a sea of imperative, low-level instructions that must be blindly executed in exact sequence. This contrasts with LINQ queries, which preserve the programmer’s exact intent and allows the execution infrastructure to be much smarter. A great example here is the Parallel LINQ (PLINQ) API that parallelizes query execution on concurrent hardware with practically no changes required to the source code.

Of course, the creation of a new technology such as LINQ is really only the first part of our job. The next step is to find ways to explain our new technology to the world of developers.

Essential LINQ is an important book because it provides a clear, easy-to-understand explanation of what LINQ does, how it does it, and the many practical ways you can use this technology to make your daily programming life easier and more productive.

Both authors of this text bring an important set of skills to this project. Throughout the development of LINQ, I worked daily with Dinesh Kulkarni in this role as Program Manager for the LINQ to SQL project. Few understand LINQ to SQL better than Dinesh, and the many insights he provides into LINQ will prove to be an invaluable tool for any reader of this book. The chapters Dinesh contributed to this book will be a resource that developers will frequently mine for their rich, well-thought-out content.

I’ve known Charlie Calvert since we worked together on Turbo Pascal and Delphi at Borland International. Charlie is an accomplished author with a gift for finding the key threads in a technology and explaining them to readers in a clear, easy-to-understand prose style. He is also one of nicest people I’ve met.

Charlie and Dinesh each bring important skills to this project that have enabled them to create an excellent book that shows how LINQ works and the many practical ways you can use it in your daily development process.

Anders Hejlsberg
Redmond, WA
February 2009


© Copyright Pearson Education. All rights reserved.

From the B&N Reads Blog

Customer Reviews