LINQ之select方法选择多个字段

单个字段:

var list1 = list.Select(field1 => field1.CouponID).ToList();

多个字段:

var list1 = list.Select(field1 => new { field1.CouponID, field1.EndDate }).ToList();

全部映射:

var list1 = list.Select(field1 => field1).ToList();

 

文章来自:http://www.cnblogs.com/superfeeling/p/4728830.html
© 2021 jiaocheng.bubufx.com  联系我们
ICP备案:鲁ICP备09046678号-3