Walaa wrote:
The filter was not supplied to the GetScalar call. You only used the filter in the first query "children.GetMulti(filter);"
GetScalar() should have other overloads that accept a filter.
Thanks Walaa, that works great now. I was under the impression that since the children collection was already filtered, there was no need for me to re-filter it just to perform a MAX.
I'm sure there's a good reason behind it though.
Thanks!
By the way, while waiting for your response, I decided to just manually loop through the children collection and figure out the MAX value that way instead.
Ironically, now that I think about it, since the children collection is already filtered, I might as well save one DB call by keeping the for-loop instead of using GetScalar(...). What do you think?