Last active
May 26, 2021 17:30
-
-
Save Lahirutech/64f8e736a776f73c03ca53dfdefbb0b2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var students = new List<Student>() { | |
new Student(){ Id = 1, Name="Bill"}, | |
new Student(){ Id = 2, Name="Steve"}, | |
new Student(){ Id = 3, Name="Ram"}, | |
new Student(){ Id = 4, Name="Abdul"} | |
}; | |
//get all students whose name is Bill | |
var result = from s in students | |
where s.Name == "Bill" | |
select s; | |
foreach(var student in result) | |
Console.WriteLine(student.Id + ", " + student.Name); | |
/* | |
1, Bill | |
5, Bill | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment