I'm trying order a linq to nhibernate query by the sum of it's
children.

session.Linq<Parent>().OrderBy( p => p.Children.Sum( c =>
c.SomeNumber ) ).ToList()

This does not seem to work. When looking at NHProf, I can see that it
is ordering by Parent.Id. I figured that maybe it was returning the
results and ordering them outside of sql, but if I add a .Skip
( 1 ).Take( 1 ) to the linq query, it still orders by Parent.Id.

I tried doing this with an in memory List<Parent> and it works just
fine.

Am I doing something wrong, or is this an issue with linq to
nhibernate?

I'm sure I could always return the list, then do the operations on
them, but that is not an ideal workaround, because I don't want to
return all the records.

Thanks.

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