T
Tony Johansson
Hello!
I have this linq query below with two lambda expressions.
If I look at the documentation for Where operator it says.
public static IEnumerable<T> Where<T>(
this IEnumerable<T> source,
Func<T, bool> predicate);
In my case where I have a Where operator it will match the second row that
says
Func<T, bool> predicate
In my where operator, T is an int and I return bool.
Now to my question what does it mean with the first row that says
* this IEnumerable<T> source *
and what can it be used for ?
int[] nums = new int[] {6,2,7,1,9,3};
IEnumerable<int> numsLessThenFour = nums
..Where(i => i<4)
..OrderBy(i => i);
foreach(int number in numsLessThenFour )
Console.WriteLine(number);
//Tony
I have this linq query below with two lambda expressions.
If I look at the documentation for Where operator it says.
public static IEnumerable<T> Where<T>(
this IEnumerable<T> source,
Func<T, bool> predicate);
In my case where I have a Where operator it will match the second row that
says
Func<T, bool> predicate
In my where operator, T is an int and I return bool.
Now to my question what does it mean with the first row that says
* this IEnumerable<T> source *
and what can it be used for ?
int[] nums = new int[] {6,2,7,1,9,3};
IEnumerable<int> numsLessThenFour = nums
..Where(i => i<4)
..OrderBy(i => i);
foreach(int number in numsLessThenFour )
Console.WriteLine(number);
//Tony