join - 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; }
}
解决方案
推荐阅读
- javascript - 控件和循环不适用于 Youtube 视频(YouTube API)
- javascript - feathersjs 频道的事件不会传递给客户端
- javascript - 用于多语言页面上的 onclick 元素的缓存
- html - 我可以仅将 ' ' 之类的转义序列用于样式目的吗?
- amazon-web-services - 我应该如何可视化与 AWS ALB 的 WebSocket 连接?
- ruby-on-rails - 是否可以将功能从一个模型重定向到另一个模型
- python - NumPy 数组花式索引
- vba - 用于表中自动列检测的 Vba 脚本
- r - 如何更改不同语言环境中的字母?
- react-native - 我如何在“React-Native”中实现“ONVIF”协议?