读书笔记-《LINQ to Objects Using C#4.0》(1)

园子里面看到关于LINQ的文章比较少,所以想做一个系列,大家一起学习下如何使用LINQ to Objects。

这里博主正在阅读的是Troy  Magennis写的《LINQ to Objects Using C#4.0》

本系列文章,提供该书内容的精简。

 
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  

第一章 LINQ 介绍

   什么是LINQ?

     Language Integrated query(直译为语言集成查询) 读作 link(零克,是不是很轻的感觉呢^^)

LINQ是微软新推出的增强功能,用来处理一些数据。LINQ在.NET语言和各种数据源之间提供了一层编码抽象。

推出LINQ,其中一个目的是减少代码的复杂度和增强代码的阅读性。LINQ是开放的、可扩展的。

从.NET3.5开始支持LINQ,并在.NET4中进一步扩展。

   涵盖的点

  • LINQ to Objects
  • LINQ to XML
  • LINQ to Entities(part of the Entity Framework)
  • LINQ to SQL
  • PLINQ
  • LINQ to Datasets

   标准查询操作表(.net4)

操作类型

标准查询操作名

Aggregation

Aggregate, Average, Count, LongCount, Max, Min, Sum

Conversion

AsEnumerable, Cast, OfType, ToArray, ToDictionary, ToList, ToLookup

Element

DefaultIfEmpty, ElementAt, ElementAtOrDefault, First,
FirstOrDefault, Last, LastOrDefault, Single, SingleOrDefault

Equality

SequenceEqual

Generation

Empty, Range, Repeat

Grouping

GroupBy, ToLookup

Joining

GroupJoin, Join

Merging

Zip

Ordering

OrderBy, ThenBy, OrderByDescending, ThenByDescending, Reverse

Projection

Select, SelectMany

Partitioning

Skip, SkipWhile, Take, TakeWhile 

Quantifiers

All, Any, Contains

Restriction

Distinct, Where

Set

Concat, Except, Intersect, Union

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

下一章


转载于:https://www.cnblogs.com/helloworldexcepition/archive/2012/01/11/2316750.html

Book Description Your Complete Example-Rich Guide to Using and Extending LINQ to Objects and PLINQ Using LINQ to Objects, .NET developers can write queries over object collections with the same deep functionality that was once available only with SQL and relational databases. Now, for the first time, developers have a comprehensive and authoritative guide to applying LINQ to Objects in real-world software. Microsoft MVP Troy Magennis introduces state-of-the-art techniques for working with in-memory collections more elegantly and efficiently—and writing code that is exceptionally powerful, robust, and flexible. Drawing on his unsurpassed experience coding software using LINQ and hosting the popular HookedOnLINQ.com site, Magennis presents timely, realistic solutions to a wide spectrum of development challenges, such as combining data from multiple sources, and achieving optimal performance with extremely large sets of data. You’ll begin with brief quick-starts that walk you through LINQ to Objects’ key features and query syntax. Next, you’ll drill down to detailed techniques for applying and extending these features with C# 4.0 and C# 3.0—including code examples that reflect the realities of production development. Coverage includes • Writing basic LINQ queries with C#: filtering, projecting, and sorting data from in-memory collections • Mastering advanced techniques for grouping and joining data and understanding the performance implications of each technique • Taking full advantage of LINQ’s standard query operators • Creating custom query operators that follow best practices for coding patterns and error handling • Writing more fluent, readable LINQ queries with C# 4.0’s language enhancements, including the new dynamic features • Combining LINQ with COM-Interop to access data sources such as Microsoft Excel • Using Parallel LINQ to Objects (PLINQ) to optimize queries for multi-core processors, and how to build custom parallel query operators • Integrating the best LINQ to Objects patterns into your day-to-day coding About the Author Troy Magennis is a Microsoft C# MVP and a keen traveler who currently works for Travelocity, which manages the travel and leisure websites travelocity.com, lastminute.com, and zuji. As Vice President of Architecture, he leads a talented team of architects spread across four continents, committed to being the traveler’s champion. Technology has always been a passion. After cutting his teeth on early 8-bit personal computers, Troy moved into electronic engineering (assembly language coding), which later led to positions in software application development and architecture for some of the most prominent corporations in automotive, banking, and online commerce. Troy’s first exposure to LINQ was in 2006 when he took a sabbatical to learn it and became hooked, ultimately leading him to publish the popular HookedOnLINQ website. Book Details Paperback: 336 pages Publisher: Addison-Wesley Professional; 1 Pap/Pas edition (March 12, 2010) Language: English ISBN-10: 0321637003 ISBN-13: 978-0321637000
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值