EnumerableExtensions。由于其保护级别而无法访问

时间:2018-07-29 13:04:32

标签: join asp.net-core-webapi ef-core-2.1

由于保护级别错误,

无法获得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; }
}

0 个答案:

没有答案