I am experiencing a weird error while executing an NHibernate Query.
I have a query of type IQueryOver<ExternalUser, ExternalUser>
which is filtered and transformed (using DistinctRootEntity, which i am guessing is causing the problem). I create the query like this:
List<Guid> companyList = /* some guids */
Company company = null;
var query = _session.QueryOver<ExternalUser>()
.JoinAlias(x => x.Companies, () => company)
.Where(() => company.Id.IsIn(companyList))
.TransformUsing(Transformers.DistinctRootEntity);
When i execute query.RowCountInt64()
i get 4.
When i execute query.List()
i get 3 items back.
I have also tried query.ToRowCountInt64Query().List<long>().Sum()
which also gives me 4.
I also tried query.ToRowCountInt64Query().FutureValue<long>().Value
which also gives me 4.
Any ideas how to solve this?