【发布时间】:2022-02-18 10:56:07
【问题描述】:
我从数据库制作了一个 dotnet ef 脚手架,生成的类是:
public partial class Course
{
public int Id { get; set; }
public string? Description { get; set; }
}
public partial class Student
{
public int Id { get; set; }
public string? Name { get; set; }
}
public partial class StudentCourse
{
public int? IdStudent { get; set; }
public int? IdCourse { get; set; }
public virtual Student? IdStudentNavigation { get; set; }
public virtual Course? IdCourseNavigation { get; set; }
}
我想获取 Student 的列表,其中 Course 的 id 是 X
我试过 _context.Student.Include("StudentCourse").Where(x=>x.Any(....) 但 Intellisense 不接受“Any”函数。
我怎样才能得到这个?
【问题讨论】:
标签: .net-core entity-framework-core asp.net-core-webapi