Written By:-Isha Malhotra
Our Website:-www.techaltum.com
Our Website:-www.techaltum.com
First and Last in
LINQ
Use of First in LINQ
First method
in LINQ just select the top 1 value from the data source.
For Example:-
First with array
int[] marks = new int[] { 23, 45, 78, 45, 56, 89, 56, 32 };
int first = marks.First();
Response.Write("First Element " + first);
Ouput
We can also
pass condition while calling first method