Using linq to NHibernate (NHibernate v3) I have the following LINQ query:
var session = this.GetSession();
var rgn = this.Get(regionId);
var query = from t in session.Query<Tag>()
where
!(
from trn in session.Query<Translation>()
where trn.Region.Id == regionId
select trn.Tag.Id
)
.Contains(t.Id)
select new Translation() {Id = t.Id, Tag = t, Region = rgn, TagTranslation=""};
var count = query.Count();
var untranslatedTags = query.Skip((page - 1)*pageSize).Take(pageSize);
var countAfterSkipAndTake = untranslatedTags.Count();
return untranslatedTags.ToList();
}
the count variable does indeed return the expected value. However countAfterSkipAndTake returns the same value. I would hve expected it to return pageSize (which in this case is 15). The final line untranslatedTags.ToList() returns an exception. I believe LINQ to NHibernate is not fully implemented, before I try and download the trunk can anyone see anything obvious I've done wrong.