SortListingPropertiesByGroupId Method

Orders the listing properties according to their corresponding group identifier.

Namespace:  Microsoft.Dynamics.Commerce.Runtime.DataModel
Assembly:  Microsoft.Dynamics.Commerce.Runtime (in Microsoft.Dynamics.Commerce.Runtime.dll)

public void SortListingPropertiesByGroupId()

This is an idle method, as the listing attributes are retrieved at construction time ordered by group id. This fact needs to be signaled to the consumer. The options are: - expose grouped properties, either by the default accessor, or via an additional one: undesirable, as the properties have already a dictionarized representation (by language), and adding yet another level of keys/grouping makes for unwieldy access to the listing's properties; - do nothing: the caller has to incur the cost of sorting/grouping the properties - inefficient.

- expose properties sorted by group and provide a guarantee of this fact to the caller: in this case, the caller can safely dictionarize the property collection in a single pass (O(n) of properties, each property O(1)). The function itself is a no-op, but it enforces the contract between the caller and the listing object.

Community Additions