zoukankan
html css js c++ java
LinQ Coding (1)
Linq Search Process
Linq To ArrayList
public
class
Student
{
public
String FirstName
{
get
;
set
; }
public
String LastName
{
get
;
set
; }
public
Int32[] Scores
{
get
;
set
; }
}
public
class
LinqToArrayList : Interface
{
Interface Members
#region
Interface Members
public
void
invoke()
{
ArrayList arrList
=
new
ArrayList();
arrList.Add(
new
Student
{
FirstName
=
"
Svetlana
"
,
LastName
=
"
Omelchenko
"
,
Scores
=
new
int
[]
{
98
,
92
,
81
,
60
}
}
);
arrList.Add(
new
Student
{
FirstName
=
"
Claire
"
,
LastName
=
"
O’Donnell
"
,
Scores
=
new
int
[]
{
75
,
84
,
91
,
39
}
}
);
arrList.Add(
new
Student
{
FirstName
=
"
Sven
"
,
LastName
=
"
Mortensen
"
,
Scores
=
new
int
[]
{
88
,
94
,
65
,
91
}
}
);
arrList.Add(
new
Student
{
FirstName
=
"
Cesar
"
,
LastName
=
"
Garcia
"
,
Scores
=
new
int
[]
{
97
,
89
,
85
,
82
}
}
);
var query
=
from Student student
in
arrList
where
student.Scores[
0
]
>
95
select student;
foreach
(Student s
in
query)
Console.WriteLine(s.LastName
+
"
:
"
+
s.Scores[
0
]);
Console.WriteLine(
"
press any key to exit.
"
);
Console.ReadKey();
}
#endregion
}
查看全文
相关阅读:
用python将博客园的文章爬取到本地
2016.7.9
2016.7.8
2016.7.7
2016.7.5
2016.7.4
2016.7.3
2016.7.2
2016.6.28
2016.6.27
原文地址:https://www.cnblogs.com/qfb620/p/1116122.html
最新文章
json数据返回数字,页面显示文字处理
Meta标签中的format-detection属性及含义
用table布局和div布局的区别
父、子、兄弟节点查找方法
关于js语法(运算中出现无限大的问题)本身的错误的解决方案
js处理小数方法
js中in关键字的用法
js关闭当前页面
泛函数(泛函)的概念
关于function构造函数特别注意的
热门文章
call()和apply()方法(切换上下文)
hdu 5726 GCD 倍增+ 二分
uvalive 6888 Ricochet Robots bfs
hdu 4676 Sum Of Gcd 莫队+数论
poj 2274 The Race 最小堆
hdu 5701 中位数计数
hdu 2604Queuing dp+ 矩阵快速幂
codeforces 21D. Traveling Graph 状压dp
hdu 5029 Relief grain 树链剖分+线段树
python模拟登录博客园并爬取用户粉丝数
Copyright © 2011-2022 走看看