Following is the linq query sample which returns the elements of array in ascending order and are greater then 5
var query = from v in AValues
where v > 5
orderby v ascending
select v;
Now we can retrieve the values from v with the help of the foreach loop in following manner
foreach(int vItem in v)
{
MessageBox.Show(vItem.ToString());
}
now the code of abive query will be converted by the compiler as the following
IEnumerable
No comments:
Post a Comment