List<TaskBatch> sourceList = (from c in BatchCollecion
                                              group c by new
                                                  {
                                                      c.CustomId,
                                                      c.OutsourcingDate,
                                                      c.ServiceId
                                                  } into grp
                                              select grp.First()).ToList();

 

或者

            List<TaskBatch> sourceList = BatchCollecion.GroupBy(x => new { x.CustomId, x.ServiceId, x.OutsourcingDate }).Select(x => x.First()).ToList();

posted on 2014-02-13 18:45  swarb  阅读(420)  评论(0编辑  收藏  举报