> I just upgraded to NH 3 Alpha. Some of my original unit tests failed and
> this one bothers me as to why its failing.
> 
> This Fails
> int result = Repository.Where(x => !x.IsDeleted).Where(x => x.Parent ==
> null).Count();
> 
> This Succeeds (calling ToList() before second where) int result =
> Repository.Where(x => !x.IsDeleted).ToList().Where(x => x.Parent ==
> null).Count();

        yes, because the second where is done in-memory, so the second where
is the problem.

> also this Succeeds (proving it can't be a mapping issue) int result =
> Repository.Where(x => !x.IsDeleted).Count()

        but, does
int result = Repository.Where(x => x.Parent == null).Count();

        work? Likely not :)

> The error I get is
> No persister for: Common.Entity.EntityBase.
> 
> EntityBase is just an abstract class I inherit from that provides me some
> common properties for all entities.

        x=>x.Parent == null, might run into this problem, no idea. If you
do:
int result = Repository.Where(x => !x.IsDeleted).Where(x => x.Parent.Id ==
null).Count();

        does that fix it? If so, the code path which translates
parameter.Member == null to a pk predicate isn't 100% fail safe.

                FB


> 
> Any ideas ??
> 
> --
> You received this message because you are subscribed to the Google Groups
> "nhusers" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/nhusers?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en.

Reply via email to