本文  学习自  微软官网文档   2016/12

LINQ 背景  

以前写与DB 相关的代码, 程序员须要懂开发语言(C#, VB)和查询语言跟数据库交互。 LINQ 的出现使应用程序形成基于集合的查询。你可以编写针对各种数据源的(实现IEnumerable 接口的数据源)查询 。LINQ适用于内存的数据结构,XML文档,SQL数据库和DataSet对象。

查询是一种从数据源检索数据的表达式。查询通常用专门的查询语言来表示。随着时间的推移,人们已经为各种数据源开发了不同的语言;例如,用于关系数据库的 SQL 和用于 XML 的 XQuery。因此,开发人员不得不针对他们必须支持的每种数据源或数据格式而学习新的查询语言。LINQ 通过提供一种跨各种数据源和数据格式使用数据的一致模型,简化了这一情况。在 LINQ 查询中,始终会用到对象。可以使用相同的基本编码模式来查询和转换 XML 文档、SQL 数据库、ADO.NET 数据集、.NET 集合中的数据以及对其有 LINQ 提供程序可用的任何其他格式的数据。

LINQ 介绍

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAdIAAAFFCAIAAADXYfuaAAAgAElEQVR4nO2dfXATV5rue2pSW2RiVWX+IsjipmqqSEY4CxXEbhl2HFVqbigsnEyyl9guT6ikyKBJhizjGDyz47sgFq4TCIIM5gbSxrEZgxI5A7YjMjIkjgW2wRAagz9wiE0IYu1AXB5XIOvsZD/m3j/e4t0z3ZKsz27Jep56ihJyf5z3dJ9fv3369JH0/yAIgiAdJRldAAiCoOwSsAtBEKSr/hu7165d2wxBEAQlW2Gxe+LECXOuxQlBEAQlT5Kk7lT4C+zabDYFgiAISp6AXQiCIF0F7EIQBOkqYBeCIEhXAbsQBEG6CtiFIAjSVcAuBEGQrgJ2IQiCdBWwC0EQpKuAXQiCIF0F7KavZFmWZdnn89F/fT6fLMuBQEBRlEAgIP+lfD6f9ktZlj0ej2qzHo+Ht5PRUsWboRG5XC6bzeZyuUL+1ePx0Oukbrdb33JBKRSwm76SJEmSJKs1j4BCr3LLsqwoiizL0l/K6XRqv5QkSXsEbTYbbyejpYo3ckRUe06nU4cixdRqIhTMbreLAVqteXwNhj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jrLzPNcK2A0tn89H7VM8mVwul8vl4kEzJPGE83g8tBZnr7SdiooK7vZlmvDCWXsuisPp6DdgAoFAIBDgSqZeb16MaszlcomDQ2jhQCDg8/n4uFC1i4dJTIrFfh6qf/5r1nb4RCmPxyN26VLeoGhGRorHwikIw6JJwG788ng8brdb27cAQRAUQcBu/JJlGRdwCIJiFbALQRCkq4BdCIIgXQXsQhAE6SpgF4IgSFcBuxAEQboK2IUgCNJVwC4EQZCuAnYhCIJ0FbALQRCkq6bBLs1MCEEQBCVLkbD71VdfnYAgCIKSrbDYhSAIgnQQsAtBEKSrgF0IgiBd9f8BfESNmn9FgmQAAAAASUVORK5CYII=" alt="" />

所有 LINQ 查询操作都由以下三个不同的操作组成:

  1. 获取数据源。

  2. 创建查询。

  3. 执行查询

下图显示了完整的查询操作。在 LINQ 中,查询的执行与查询本身截然不同;换句话说,如果只是创建查询变量,则不会检索任何数据。

class IntroToLINQ
{
static void Main()
{
// The Three Parts of a LINQ Query:
// 1. Data source.
int[] numbers = new int[7] { 0, 1, 2, 3, 4, 5, 6 }; // 2. Query creation.
// numQuery is an IEnumerable<int>
var numQuery =
from num in numbers
where (num % 2) == 0
select num; // 3. Query execution.
foreach (int num in numQuery)
{
Console.Write("{0,1} ", num);
}
}
}

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAARUAAAFyCAIAAABUfdlXAAAgAElEQVR4nO2dX4zUVr7n6yVPLYJ5WTTkDxYvEEUJfugRCsqqnb0XaSS0xMwLD8DFq1FW2egKrBVo1fdmJp7O7O4NygUzO4JIyxDP7mVye+5sj2c66Uky0DEhEEiTjotu/jR0Ok43IRBoYiDDhAHK+/BNn5zYVa7q6rLLf35f/dRyV52yXVXnU79zfuec3yn5JBKpWZXafQMkUoZF/JBIzYv4IZGaF/FDIjUv4odEal7ED4nUvOrw43meaZqu6+Jfx3HivyUSKTOK4seyLF3XZVm2bVuWZd/3RVH0PI8vo+u6bdu2bYuiKM9IFEXbtlFAlmXHcXAeX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以调用 ToList<TSource>ToArray<TSource> 方法。

C# 3.0 特性

不必在声明并初始化变量时显式指定类型,您可以使用 var 修饰符来指示编译器推断并分配类型,如下所示:

通过对象和集合初始值设定项,初始化对象时无需为对象显式调用构造函数。初始值设定项通常用在将源数据投影到新数据类型的查询表达式中。假定一个类名为 Customer,具有公共 Name 和 Phone 属性,可以按下列代码中所示使用对象初始值设定项:

Customer cust = new Customer {Name = "Mike" ; Phone ={ "555-1212 "};

匿名类型由编译器构建,且类型名称只可用于编译器。匿名类型提供了一种在查询结果中临时分组一组属性的方便方法,无需定义单独的命名类型。使用新的表达式和对象初始值设定项初始化匿名类型,如下所示:

select new {name = cust.Name, phone = cust.Phone};

通过自动实现的属性,可以更简明地声明属性。当您如下面的示例中所示声明属性时,编译器将创建一个私有的匿名支持字段,该字段只能通过属性 getter 和 setter 进行访问。

public string Name {get; set;}

PLINQ 介绍

并行 LINQ (PLINQ) 是 LINQ 模式的并行实现。 PLINQ 查询在许多方面类似于非并行 LINQ to Objects 查询。 与顺序 LINQ 查询一样,PLINQ 查询对任何内存中 IEnumerableIEnumerable<T> 数据源进行操作,并推迟执行,这意味着在枚举查询之前不会开始执行这些操作。 主要区别是 PLINQ 尝试充分利用系统中的所有处理器。 它利用所有处理器的方法是,将数据源分成片段,然后在多个处理器上对单独工作线程上的每个片段并行执行查询。 在许多情况下,并行执行意味着查询运行速度显著提高。


通过并行执行,PLINQ 通常只需向数据源添加 AsParallel 查询操作,即可在某些查询类型的旧版代码上获得显著的性能改进。 但是,并行可能引入其自己的复杂性,因此并非所有查询操作在 PLINQ 中都运行得更快。 事实上,并行降低了某些查询的速度。 因此,您应了解诸如排序等问题如何影响并行查询。 有关详细信息,请参阅 Understanding Speedup in PLINQ

PLINQ 的主要用途是通过在多核计算机上以并行方式执行查询委托来加快 LINQ to Objects 查询的执行速度。

 

.net LINQ and PLINQ的更多相关文章

  1. 四、并行编程 - 并行LINQ(PLINQ) 的使用。AsParallel

    用于对内存中的数据做并行运算,也就是说其只支持 LINQ to Object 的并行运算 一.AsParallel(并行化) 就是在集合后加个AsParallel(). 例如: , ); == ); ...

  2. PLINQ 并行操作Linq

    C#并行编程-PLINQ:声明式数据并行   目录 C#并行编程-相关概念 C#并行编程-Parallel C#并行编程-Task C#并行编程-并发集合 C#并行编程-线程同步原语 C#并行编程-P ...

  3. .NET面试题系列[15] - LINQ:性能

    .NET面试题系列目录 当你使用LINQ to SQL时,请使用工具(比如LINQPad)查看系统生成的SQL语句,这会帮你发现问题可能发生在何处. 提升性能的小技巧 避免遍历整个序列 当我们仅需要一 ...

  4. C#并行编程-PLINQ:声明式数据并行

    目录 C#并行编程-相关概念 C#并行编程-Parallel C#并行编程-Task C#并行编程-并发集合 C#并行编程-线程同步原语 C#并行编程-PLINQ:声明式数据并行 背景 通过LINQ可 ...

  5. C#并行编程-PLINQ:声明式数据并行-转载

    C#并行编程-PLINQ:声明式数据并行   目录 C#并行编程-相关概念 C#并行编程-Parallel C#并行编程-Task C#并行编程-并发集合 C#并行编程-线程同步原语 C#并行编程-P ...

  6. C#基础提升系列——C# LINQ

    C# LINQ LINQ(Language Integrated Query,语言集成查询).在C# 语言中集成了查询语法,可以用相同的语法访问不同的数据源. 命名空间System.Linq下的类En ...

  7. C#与C++的发展历程第二 - C#4.0再接再厉

    系列文章目录 1. C#与C++的发展历程第一 - 由C#3.0起 2. C#与C++的发展历程第二 - C#4.0再接再厉 开始本系列的第二篇,这篇文章中将介绍C#4.0中一些变化,如C++有类似功 ...

  8. .NET并行编程实践(一:.NET并行计算基本介绍、并行循环使用模式)

    阅读目录: 1.开篇介绍 2.NET并行计算基本介绍 3.并行循环使用模式 3.1并行For循环 3.2并行ForEach循环 3.3并行LINQ(PLINQ) 1]开篇介绍 最近这几天在捣鼓并行计算 ...

  9. 精通C#(第6版)

    <精通C#(第6版)> 基本信息 原书名:Pro C# 5.0 and the .NET 4.5 framework,sixth edition 作者: (美)Andrew Troelse ...

随机推荐

  1. [置顶] Effective STL 学习笔记

    看Effective STL 作的一些笔记,希望对各位有帮助. 以下是50条条款及相关解释. 容器 1. 慎重选择容器类型,根据需要选择高效的容器类型. 2. 不要试图编写独立于容器类型的代码. 3. ...

  2. MAC 终端 显示隐藏文件 关闭显示隐藏文件

    1.显示隐藏文件夹显示:defaults write com.apple.finder AppleShowAllFiles -bool true (1)复制“defaults write com.ap ...

  3. Redis实战

    大约一年多前,公司同事开始使用Redis,不清楚是配置,还是版本的问题,当时的Redis经常在使用一段时间后,连接爆满且不释放.印象中,Redis 2.4.8以下的版本由于设计上的主从库同步问题,就会 ...

  4. [React Native] Complete the Notes view

    In this final React Native lesson of the series we will finalize the Notes view component and squash ...

  5. [React Native] Build a Github Repositories component

    Nav to Repos component from Dashboard.js: goToRepos(){ api.getRepos(this.props.userInfo.login) .then ...

  6. android136 360 拖拽

    差补器原理: 图标拖拽:     activity_drag_view.xml <?xml version="1.0" encoding="utf-8"? ...

  7. 初探 MySQL 的 Binlog

    https://xcoder.in/2015/08/10/mysql-binlog-try/

  8. C#_MVC 自定义AuthorizeAttribute实现权限管理

    随笔- 28  文章- 31  评论- 16 MVC 自定义AuthorizeAttribute实现权限管理   在上一节中提到可以使用AuthorizeAttribute进行权限管理: [Autho ...

  9. 查看MAC系统JRE和JDK版本

    经常有些软件有JRE或者JDK的版本要求,但怎么查询MAC上现在的JRE或JDK的版本呢?很简单,用这两个命令 这个是查询JRE的版本: $ java -version java version &q ...

  10. NSURLSession、NSURLConnection

    NSURLSesstion GET方法 block回调方法NSString * urlStr = @"http://192.168.1.247:8100/stream?cname=cha_2 ...