首页 > 解决方案 > EnumerableExtensions.Join 由于其保护级别而无法访问

问题描述

由于保护级别错误,无法访问可枚举扩展连接。我正在使用 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; }
}

标签: joinasp.net-core-webapief-core-2.1

解决方案


推荐阅读