> YES Running your below statement works! But why is that again? This does
not
> seem intuitive. Is this a bug with new NH linq provider int result =
> Repository.Where(x => !x.IsDeleted).Where(x => x.Parent.Id ==
null).Count();

        I *think* there's a bug, in the form of a missing feature, namely,
that you compare a member which is mapped as navigator onto a relationship
(e.g. order.Customer) with null it should be seen as a comparison of the FK
field(s) of the containing type for the relationship (e.g. order.CustomerID,
not mapped as a field, but present in the target) with null.

                FB

> 
> On Aug 27, 2:51 am, "Frans Bouma" <[email protected]> wrote:
> > > 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.

-- 
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