日期:2014-05-20  浏览次数:20959 次

Linq 分组或者去重
   public List<fuction> Getlist(string School)
        {
            Db_Jst_ChatgroupDataContext S_Info = new Db_Jst_ChatgroupDataContext();
            IQueryable<fuction> item = from G_info in S_Info.Group_Info1
                                       from G_School in S_Info.Group_SchoolInfo
                                       where G_info.Gschool.Equals(School)
                                       select new fuction
                                       {
                                           省份 = G_info.Gprovince,
                                           学校 = G_info.Gschool,
                                           班级 = G_info.GroupName,
                                           联系人 = G_School.Contact,
                                           联系邮箱 = G_School.Email,
                                           联系电话 = G_School.Tel
                                       };
            return item.ToList();
        }

------解决方案--------------------
本帖最后由 q107770540 于 2012-11-13 17:51:11 编辑
public class FuctionComparer : IEqualityComparer<fuction>