QuoteReplyTopic: Bug/Issue with orderby GUIDs in cache Posted: 20-Jul-2010 at 11:24pm
Slightly unusual bug here...
SQL Server does not order GUIDs in the same way as .NET, so if you query against the cache you will get very different search order results to the server's returned order.
According to Microsoft's doco the SQL Server uses only the last eight digits of the GUID for sorting. This is a total pain in the bum, but such is life. We use the following extension to Guid to ensure our internal sorts match SQL Server's:
public static int CompareToSql(this Guid left, Guid value) { return (left.ToString().Substring(24).CompareTo(value.ToString().Substring(24))); }
The cache in DF appears to do a regular sort, so in some cases (such as ours, surprise surprise) it breaks if the QueryStrategy is not set to QueryStrategy.DataSourceOnly
Just another interesting issue found while converting an EF4 app to IdeaBlade :)
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum