I have a query using linq to NHibernate, for EnterAndExitArchive
entity. This entity has a association by Archive
entity.
public EnterAndExitArchive GetLastEnterAndExitArchive(long archiveId)
{
var q = SessionInstance.Query<EnterAndExitArchive>()
.Where(x => x.Archive.Id == archiveId)
.LastOrDefault<EnterAndExitArchive>();
return q;
}
Or
public EnterAndExitArchive GetLastEnterAndExitArchive(long archiveId)
{
var q = SessionInstance.Query<EnterAndExitArchive>()
.LastOrDefault<EnterAndExitArchive>(x => x.Archive.Id == archiveId);
return q;
}
But this has a runtime error. Message of exception is The LastResultOperator result operator is not current supported
.
Why?