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

Linq 2个表连接问题
   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
                                       join G_School in  S_Info.Group_SchoolInfo on G_info.Gschool equals G_School.Gschool
                                       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();
        }


如果联系人为空的话,查询出来的东西,会自动给其它名字,这是什么原因?(如果联系人不为空的话查询出来的东西不会出现这种效果,其它项为空也没有出现这种情况,例如省份为空)求解决方法。求代码指点,Linq菜鸟.
------最佳解决方案--------------------
public List<fuction> Getlist(string School)