Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/299.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# LINQ JOIN查询返回的值不';不存在于一个表中_C#_Linq_Linq To Entities - Fatal编程技术网

C# LINQ JOIN查询返回的值不';不存在于一个表中

C# LINQ JOIN查询返回的值不';不存在于一个表中,c#,linq,linq-to-entities,C#,Linq,Linq To Entities,我有一个Linq to Entities查询,例如: public IQueryable<Teachers> GetTeachersByKey() { return from t in this.Context.Teachers join t2 in this.Context.Table2 on t.Teacher_K equals t2.Teacher_K select t; } public IQueryable gettea

我有一个
Linq to Entities
查询,例如:

public IQueryable<Teachers> GetTeachersByKey()
{
    return from t in this.Context.Teachers
           join t2 in this.Context.Table2 on t.Teacher_K equals t2.Teacher_K
           select t;
}
public IQueryable getteacherByKey()
{
在this.Context.Teachers中从t返回
在t.Teacher_K等于t2.Teacher_K上的this.Context.Table2中加入t2
选择t;
}
问题是它还返回了
Teachers\u K
表中甚至不存在的值

如何更新查询以排除这些结果?
我尝试将it教师加入到其自身中,但没有任何效果。

这是内部连接的语法,因此您必须描述或提供您的结果,让任何人都知道您在说什么about@Jonesy:我描述了它:“问题是它还返回教师表中甚至不存在的教师K值”很好的网站名btowneverind,代码中还有其他加入,我删除了它,修复了这个。