我正在尝试获取所有具有FiscalYear.id
in的@events IList<int> years
。我正在使用any()
,但它引发了以下堆栈跟踪错误:
Unrecognised method call:
System.Linq.Enumerable:Boolean Any[TSource](System.Collections.Generic.IEnumerable`1[TSource], System.Func`2[TSource,System.Boolean])
有任何想法吗?这是代码:
FindAllPaged(int eventTypeId, IList<int> aors, IList<int> years)
{
IList<Domain.Event> results =
session.QueryOver<Event>()
.Where(@event => !@event.IsDeleted &&
@event.EventType.Id == eventTypeId &&
years.Any(y => y == @event.FiscalYear.Id))
}