了解LINQ [英] Learning about LINQ

查看:79
本文介绍了了解LINQ的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在这个网站上问过很多的事情之一是 LINQ .我提出的问题涉及面很广,而且种类繁多,而且往往没有太多的背景信息.因此,为了巩固我在Linq上获得的知识,我在发布此问题,以期在我继续学习LINQ时使用其他信息来维护和更新它.

One of the things I've asked a lot about on this site is LINQ. The questions I've asked have been wide and varied and often don't have much context behind them. So in an attempt to consolidate the knowledge I've acquired on Linq I'm posting this question with a view to maintaining and updating it with additional information as I continue to learn about LINQ.

我也希望它对其他想了解LINQ的人来说将成为有用的资源.

I also hope that it will prove to be a useful resource for other people wanting to learn about LINQ.

来自 MSDN :

LINQ项目是 .NET扩展集 包含的框架 语言集成的查询,集合和 转换操作.它扩展了C# 和Visual Basic与本地语言 查询语法并提供类 图书馆以利用这些 功能.

The LINQ Project is a codename for a set of extensions to the .NET Framework that encompass language-integrated query, set, and transform operations. It extends C# and Visual Basic with native language syntax for queries and provides class libraries to take advantage of these capabilities.

这意味着LINQ提供了一种使用通用语法查询各种数据源的标准方法.

What this means is that LINQ provides a standard way to query a variety of datasources using a common syntax.

当前,Microsoft提供了一些不同的LINQ提供程序:

Currently there are a few different LINQ providers provided by Microsoft:

  • Linq to Objects which allows you to execute queries on any IEnumerable object.
  • Linq to SQL which allows you to execute queries against a database in an object oriented manner.
  • Linq to XML which allows you to query, load, validate, serialize and manipulate XML documents.
  • Linq to Entities as suggested by Andrei
  • Linq to Dataset

还有很多其他内容,其中许多都在

There are quite a few others, many of which are listed here.

  • 查询多个数据源的标准化方法
  • 查询的编译时安全性
  • 在内存对象中执行基于集合的操作的优化方式
  • 调试查询的能力

Chook 提供了一种方法来 Jeff 显示如何数据表中的顺序表明显不同
Marxidad 显示如何使用Linq进行快速排序

Chook provides a way to output CSV files
Jeff shows how to remove duplicates from an array
Bob gets a distinct ordered list from a datatable
Marxidad shows how to sort an array
Dana gets help implementing a Quick Sort Using Linq

GateKiller的问题的链接摘要如下:
Scott Guthrie提供了简介到Linq在他的博客上
在MSDN上 LINQ的概述

A summary of links from GateKiller's question are below:
Scott Guthrie provides an intro to Linq on his blog
An overview of LINQ on MSDN

ChrisAnnODell 建议签出:

ChrisAnnODell suggests checking out:

  • Hooked on Linq
  • 101 Linq Samples
  • LinqPad

Linq目前在VB.Net 9.0和C#3.0中可用,因此您需要Visual Studio 2008或更高版本才能获得全部好处. (您始终可以在记事本中编写代码并使用MSBuild进行编译)

Linq is currently available in VB.Net 9.0 and C# 3.0 so you'll need Visual Studio 2008 or greater to get the full benefits. (You could always write your code in notepad and compile using MSBuild)

还有一个名为 LinqBridge 的工具这样您就可以在C#2.0中像运行查询一样运行Linq.

There is also a tool called LinqBridge which will allow you to run Linq like queries in C# 2.0.

这个问题有一些使用LINQ的棘手方法

This question has some tricky ways to use LINQ

推荐答案

对实体的LINQ:

  • Video walkthroughs
  • Channel 9 video
  • Entity framework FAQ
  • Entity framework performance

我还有很多在Delicious.com上标记过.

这篇关于了解LINQ的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆