无法获得Enumerable Extensions连接。我正在使用EF Core进行数据库连接。如何使用LINQ执行联接?
var seatBookings =(
from sb in Context.SeatBookings
join bd in Context.BookingDetails on sb.BookingId
equals bd.Id
where bd.ShowId == showId
select sb
).ToList();
public partial class SeatBookings
{
public int Id { get; set; }
public int? BookingId { get; set; }
public int SeatNumber { get; set; }
public BookingDetails Booking { get; set; }
}
public partial class BookingDetails
{
public BookingDetails()
{
SeatBookings = new HashSet<SeatBookings>();
}
public int Id { get; set; }
public int ShowId { get; set; }
public string Email { get; set; }
public string MobileNumber { get; set; }
public int TheaterId { get; set; }
public int BookedSeatsCount { get; set; }
public ShowDetails Show { get; set; }
public ICollection<SeatBookings> SeatBookings { get; set; }
}