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
}
LINQ Coding directory
- Linq Coding -- Part One
- Linq Coding -- Part Two [standard query operator]
- Linq Coding -- Part Three [Let clause]
- Linq Coding -- Part Four [Concat application]
- Linq Coding -- Part Five (Join Internal Join query)
- Linq Coding -- Part Six (Join Group Join)
- Linq Coding -- Part Seven (Join: left Outer Join, DefaultIfEmpty, GroupJoin)