Add method

void Add(
  1. PropertyDefinitionBase propertyDefinition,
  2. SortDirection sortDirection
)
Adds the specified property definition / sort direction pair to the collection. The property definition. The sort direction.

Implementation

void Add(
  PropertyDefinitionBase propertyDefinition,
  SortDirection sortDirection,
) {
  if (Contains(propertyDefinition)) {
    throw ServiceLocalException(
      "PropertyAlreadyExistsInOrderByCollection(${propertyDefinition.GetPrintableName()})",
    );
  }

  _propDefSortOrderPairList.add(
    MapEntry<PropertyDefinitionBase, SortDirection>(
      propertyDefinition,
      sortDirection,
    ),
  );
}