linq 实例

 

 

// Specify the data source.
int[] scores = new int[] { 97, 92, 81, 60 };

// Define the query expression.
IEnumerable<int> scoreQuery =
from score in scores
where score > 80
select score;

// Execute the query.
foreach (int i in scoreQuery)
{
Console.Write(i + " ");

}

posted @ 2013-09-13 08:50  程序猿网友666  阅读(151)  评论(0编辑  收藏  举报