Class PriceGroupOptimizer

Internal use only, public for testing.

Eliminates overlapping values and assigns MaxQuantity values to a set of price values.

Inheritance
System.Object
PriceGroupOptimizer
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Mediachase.Commerce.Pricing.Database
Assembly: Mediachase.Commerce.dll
Version: 10.8.0
Syntax
public class PriceGroupOptimizer

Constructors

PriceGroupOptimizer()

Declaration
public PriceGroupOptimizer()

Fields

Instance

Declaration
public static readonly PriceGroupOptimizer Instance
Field Value
Type Description
PriceGroupOptimizer

Methods

OptimizePrices(IEnumerable<IPriceValue>)

Returns an optimized list of price values representing the same pricing structure as the supplied price value list.

Declaration
public IEnumerable<PriceGroupOptimizer.OptimizedPriceValue> OptimizePrices(IEnumerable<IPriceValue> priceGroup)
Parameters
Type Name Description
System.Collections.Generic.IEnumerable<IPriceValue> priceGroup

The original price list. All values in the list are expected to be for the same catalog entry.

Returns
Type Description
System.Collections.Generic.IEnumerable<PriceGroupOptimizer.OptimizedPriceValue>

An optimized list.

Remarks

The optimized list will not have any overlapping values, and tiered pricing on quantity will always decrease or stay the same on price as the minimum quantity increases. Two price values overlap if they are for the same catalog entry, market, currency, and customer pricing, and have overlapping validity date ranges. All overlaps are resolved by taking the lower unit price.