SaaS CMS has officially launched! Learn more now.

Ability to Sort By Dictionary Value?


We're using Find 13.4.5, and attempting to use a dictionary to store computed prices where the keys are a string composed of specifc account details. We'd like to allow users to sort products by this computed value, but calling OrderBy/OrderByDescending seem to output the json request without the key IE:


where PriceDictionaryMethodName is a static method returning a Dictionary<string, decimal>. This results in no sort being applied. Modifying the request to include the key appears works correctly IE:


seems to order them correctly. Is there a way to force this in the json query? I've tried Dictionary2Find, but that doesn't seem to work. It would be great to have this work correctly for projections too.

Dec 01, 2021 22:51
Johan Kronberg - Dec 02, 2021 6:32
Is this UnifiedSearch or searching for a set type?
Michael Clausing - Dec 03, 2021 1:19
It's for a specific type using ITypeSearch.
Johan Kronberg - Dec 03, 2021 7:52
Do you have any alternatives tried out or in mind? How many keys are in the dictionary typically and how big is the model that owns the dictionary property?

Add a support ticket if you haven't already.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.