Hi friends,
Today, I will show you 3 ways to query by using
LINQ to Objects .
First we will declare and define an Array:-
int[] numbersArray = { 1, 2, 3, 4, 5}; 1st way:-
IEnumerable<int> result = from tempvar in numbersArray
select tempvar;
2nd way
(using Lambda Expression) :-
IEnumerable<int> result = numbersArray.Select(p => p);
3rd way
(using Anonymous Delegate) :-
IEnumerable<int> evens = numbersArray
.Select(delegate(int x) { return (x); });
Thanks and Regards
Akiii