-
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
}
-
相关阅读:
加快火狐启动速度的几种方法 Leone
我国的社保到底是多交好,还是少交好? Leone
“情商”和“智商”究竟有哪些区别? Leone
Atitti 知识图谱构建方法attilax 总结
Atitit 知识图谱的数据来源
Atitit java 二维码识别 图片识别
Atitit 跨平台异常处理(2)异常转换 java c# js异常对象结构比较and转换
Atitit 异常机制与异常处理的原理与概论
Atitti knn实现的具体四个距离算法 欧氏距离、余弦距离、汉明距离、曼哈顿距离
屏幕取词技术实现原理
-
原文地址:https://www.cnblogs.com/qfb620/p/1116122.html
Copyright © 2020-2023
润新知