C# Lambda表达式与Linq

       int[] arry = { 1, 3, 565, 76, 4, 32, 2 };
        //linq写法
        var res = 
            from i in arry
            select i;
        //lambda写法
        var res = arry.Select(i => i);
//Linq
        var res = 
            from s in arry
            where s%2 == 0
            select s;
        //Lambda
        var res = arry.Where(s => s % 2 == 0);
posted on 2013-11-17 13:01  神秘藏宝室  阅读(387)  评论(0编辑  收藏  举报

 >>>转载请注明出处<<<