码迷,mamicode.com
首页 > 其他好文 > 详细

LINQ

时间:2014-08-18 23:22:13      阅读:249      评论:0      收藏:0      [点我收藏+]

标签:style   blog   color   ar   art   div   amp   log   

var query =
    from c in contact
    where c.FirstName.StartsWith("S")
    && c.LastName.StartsWith("A")
    orderby c.LastName
    select c;
var query =
    contact.Where(c => c.FirstName.StartsWith("S")
                        && c.LastName.StartsWith("K")).OrderBy(c => c.LastName);

 

var query =
    from c in contact
    where c.FirstName.StartsWith("S")
    select new { c.FirstName, c.LastName, c.EmailAddress };
var query =
    contact.Select(c => new
    {
        c.FirstName,
        c.LastName,
        c.EmailAddress
    }).Where(c => c.FirstName.StartsWith("S"));

 

LINQ,布布扣,bubuko.com

LINQ

标签:style   blog   color   ar   art   div   amp   log   

原文地址:http://www.cnblogs.com/otfngo/p/3920597.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!