只是想知道如何用 LINQ 语法编写以下 SQL
select * from COESDetails
where COESNo in
(select distinct COESNo from COESDefects)
流利或查询表达式,或两者
COESDefects
有一个导航属性COESDetails
public class COESDefects
{
public int Id { get; set; }
public int COESNo { get; set; }
public string Comments { get; set; }
public virtual COESDetails COESDetails { get; set; }
}
public class COESDetails
{
public COESDetails()
{
COESDetailsCOESDefects = new List<COESDefects>();
}
public int COESNo { get; set; }
public int Postcode { get; set; }
public virtual ICollection<COESDefects> COESDetailsCOESDefects { get; set; }
}
谢谢