Table of Contents

Class PromotionRuleBase<TPromotionRuleProperties, TPriceCalculationRequest, TPriceCalculationResult>

Namespace
CMS.Commerce
Assembly
CMS.Commerce.dll

Abstract base class for a promotion rule definition.

public abstract class PromotionRuleBase<TPromotionRuleProperties, TPriceCalculationRequest, TPriceCalculationResult> : IPromotionRule<TPriceCalculationRequest, TPriceCalculationResult>, IPromotionRule where TPromotionRuleProperties : IPromotionRuleProperties, new() where TPriceCalculationRequest : IPriceCalculationRequest where TPriceCalculationResult : IPriceCalculationResult

Type Parameters

TPromotionRuleProperties

Type containing promotion rule properties.

TPriceCalculationRequest

Type of the price calculation request.

TPriceCalculationResult

Type of the price calculation result.

Inheritance
object
PromotionRuleBase<TPromotionRuleProperties, TPriceCalculationRequest, TPriceCalculationResult>
Implements
IPromotionRule<TPriceCalculationRequest, TPriceCalculationResult>
Derived
Extension Methods

Constructors

PromotionRuleBase()

protected PromotionRuleBase()

Properties

Properties

Promotion rule properties.

public TPromotionRuleProperties Properties { get; }

Property Value

TPromotionRuleProperties

Methods

IsApplicable(IPriceCalculationData<TPriceCalculationRequest, TPriceCalculationResult>, CancellationToken)

Determines whether the promotion is applicable for products in calculationData. Method should be called after properties were initialized using ConfigurePromotionRuleProperties(PromotionInfo) method.

public virtual Task<bool> IsApplicable(IPriceCalculationData<TPriceCalculationRequest, TPriceCalculationResult> calculationData, CancellationToken cancellationToken)

Parameters

calculationData IPriceCalculationData<TPriceCalculationRequest, TPriceCalculationResult>

Price calculation data.

cancellationToken CancellationToken

Cancellation token.

Returns

Task<bool>

True if the promotion is applicable for the specified calculationData, otherwise false.