我想从查询中使用此命令过滤掉结果,但出现此错误:
这是导致错误的代码:
private void Bookings_Loaded(object sender, RoutedEventArgs e)
{
WpfApplication7.AllensCroftEntities1 allensCroftEntities1 = new WpfApplication7.AllensCroftEntities1();
// Load data into Bookings. You can modify this code as needed.
var bookingsViewSource = ((CollectionViewSource)(this.FindResource("bookingsViewSource")));
var bookingsQuery = this.GetBookingsQuery(allensCroftEntities1).Where(x => x.Date == variables.date);
bookingsViewSource.Source = bookingsQuery.Execute(MergeOption.AppendOnly);
private System.Data.Objects.ObjectQuery<Booking> GetBookingsQuery(AllensCroftEntities1 allensCroftEntities1)
{
EDIT
这里是
System.Data.Objects.ObjectQuery<WpfApplication7.Booking> bookingsQuery = allensCroftEntities1.Bookings;
// To explicitly load data, you may need to add Include methods like below:
// bookingsQuery = bookingsQuery.Include("Bookings.Client").
// For more information, please see http://go.microsoft.com/fwlink/?LinkId=157380
// Update the query to include Room.Bookings data in Bookings. You can modify this code as needed.
bookingsQuery = bookingsQuery.Include("Room.Bookings");
// Returns an ObjectQuery.
return bookingsQuery;
}
顺便编辑这里是我的问题的视频,如果它有助于解决问题 的视频
现在编辑我收到此错误: