NHibernate.Linq count throws NHibernate.QueryException : could not resolve property?

Got it. The problem was in the linq expression. It didn't like .

Count for some reason. This might be a bug in NLinq (NH2), but I hear NH3 linq is rock solid now.

Got it. The problem was in the linq expression. It didn't like .

Count for some reason. This might be a bug in NLinq (NH2), but I hear NH3 linq is rock solid now. Anyway, my solution is to use a Criteria instead: var categories = session.

CreateCriteria(typeof (Category)) . Add(Restrictions. IsEmpty("ParentCategories")) .List(); Thanks to a blog post by nixsolutions.com for getting me on the right track.

All green again.

You should be using the Count() extension method instead of the Count property. This works fine in N Regards Jon.

1 I still get a fail with the same error msg when I use: var categories = session.Linq(). Where(c => c. ParentCategories.Count() == 0).ToList(); (...looking forward to Sharp Arch 2 :) – autonomatt Sep 30 '10 at 13:24 Doesn't work for me either... – Cocowalla Apr 25 '11 at 15:38.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions