| 11/16/2006 10:31:24 PM |
While doing some tracing, I noticed that WORM was generating 'SELECT COUNT(*) as RecordCount' commands before each query. Stepping through the code, I realized that the SkipCounts property of the relevant instance of the ObjectQuery class was being changed when called by various ObjectSpace methods that take an ObjectQuery parameter.
I'm not sure if this is by design for some reason or not, but I do know that if it isn't by design, the fix is easy -- just change lines that look like this:
ObjectQuery query = new ObjectQuery(objectQuery.ObjectType, objectQuery.WhereClause, sortClause, objectQuery.PageSize, objectQuery.PageIndex);
... to this:
ObjectQuery query = new ObjectQuery(objectQuery.ObjectType, objectQuery.WhereClause, sortClause, objectQuery.PageSize, objectQuery.PageIndex, objectQuery.SkipCounts);
There's ten or so places in the code that would require the change. Is it safe to do so, or am I opening up Pandora's box in some way that I am not thinking of? It would seem that the above is the right thing to do so the SkipCounts property as set in the initial ObjectQuery should be the "right" property. Without the above change, all Get... commands have SkipCounts set to the default value, false, without regard to what the caller states is appropriate.
|
| 11/25/2006 2:03:38 AM |
Thanks, Paul! The more I dig into your product, the more I'm glad I decided to use it in the first place.
In the meantime, for those who bother to read the forums (and everyone does, right?), it's an easy fix -- just search for each instance of a Get..() method in the ObjectSpace.cs that takes an ObjectQuery parameter and make the change.
|