Linq 学习笔记8 – Distinct, Union, Concat操作

by Kimi 12. August 2009 12:52

Kimi Yang

Distinct

示例1:

    去掉结果集中的重复项。

    或:

    显示结果为:

 

 

示例2:

    通过自定义比较器,来去除重复项。

    自定义的比较器:

 

    查询代码:

 

    或者用Lambda 表达式:

 

    显示结果为:

 

 

Union

示例1:

    使用Union 来连接两个数组。

    运行结果:

 

 

Concat

示例:

    Concat 和 Union 一样,都是用来连接两个数组,但是不同的是,Union 会去掉重复项,而Concat不会去掉。

 

    运行结果

Tags:

技术文章

Comments

8/13/2009 1:59:25 PM #

Randy

好几天没看 没想到8已经出来了

Randy | Reply

8/1/2010 7:20:03 PM #

easy way to make money online

Build Your special Internet System  You don t have to just promote other folks s solutions to create totally free cash from online promoting  Build your special solution  and make an online software for it  There is certainly easy computer software that could handle it to suit your needs  turning your passion into earnings  and carrying out it in a very hurry  And no  you don t ought to go by way of clickbank  you'll find plenty of excellent tools and computer software which will permit you have started off right now  and generally for very little

easy way to make money online | Reply

Add comment


(Will show your Gravatar icon)

biuquote
  • Comment
  • Preview
Loading



Copyright © 2009 APJ Software

最新评论

Comment RSS

公告

欢迎使用APJ Blog!

日历

<<  September 2010  >>
MoTuWeThFrSaSu
303112345
6789101112
13141516171819
20212223242526
27282930123
45678910

View posts in large calendar