EventTypeID に基づいてすべてのイベントを返すメソッドがあります。
public IList<Event> FindAll(int eventTypeId, DateTime? modifiedSince)
{
IQueryable<Event> query = this.SessionFactory.Session.Query<Event>().Where(e => e.EventType.Id == eventTypeId);
if (modifiedSince.HasValue)
{
// .ToUniversalTime() call throws NotSupportedException
query = query.Where(et => et.ModifiedDate.ToUniversalTime() >= modifiedSince.Value);
}
return query.ToList();
}
上記のように、レコードごとに .ToUniversalTime() メソッドを呼び出す方法は?
理想的には、最初に .ToList() を呼び出してからフィルターをかけたくありません。
まったくサポートされていない場合、LINQ を NHibernate に拡張してこの特定の機能をサポートするにはどうすればよいですか?