8,497
社区成员
发帖
与我相关
我的任务
分享
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();
}
public class FuctionComparer : IEqualityComparer<fuction>
{
public bool Equals(fuction f1, fuction f2)
{
return (f1.省份 == f2.省份 && f1.学校 == f2.学校);
}
public int GetHashCode(fuction t)
{
return t.ToString().GetHashCode();
}
}
return item.ToList().Distinct(new FuctionComparer ());