星期日, 12月 06, 2009

LINQ 查詢運算式


class LINQQueryExpressions
{
static void Main()
{

// 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 + " ");
}
}
}

沒有留言:

張貼留言

留個話吧:)

其他你感興趣的文章

Related Posts with Thumbnails