我正在尝试进行编译查询,但我只想让它返回一个 int
public Func<DataContext, DateTime, int>
GetNextTourNo = CompiledQuery.Compile((DataContext db, DateTime day) => ((from b in db.GetTable<BookingType>()
where b.RecordType == "H" && b.TourStartDateTime.Value.Date == day.Date
orderby b.TourID descending
select new { nextID = b.TourID +1 }).Single()));