Class GetItemDiscountValidator<TEntryPromotion>

Validates conditions for the DiscountItems target collection of a EntryPromotion promotion.

Inheritance
System.Object
GetItemDiscountValidator<TEntryPromotion>
Implements
EPiServer.Validation.IValidate<TEntryPromotion>
EPiServer.Validation.IValidate
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: EPiServer.Commerce.Validation
Assembly: EPiServer.Business.Commerce.dll
Version: 10.8.0
Syntax
public abstract class GetItemDiscountValidator<TEntryPromotion> : PromotionDataValidatorBase<TEntryPromotion>, IValidate<TEntryPromotion>, IValidate where TEntryPromotion : EntryPromotion
Type Parameters
Name Description
TEntryPromotion

The type of the entry promotion.

Constructors

GetItemDiscountValidator(LocalizationService, Func<TEntryPromotion, DiscountItems>)

Initializes a new instance of the BuyQuantityGetItemDiscountValidator class.

Declaration
protected GetItemDiscountValidator(LocalizationService localizationService, Func<TEntryPromotion, DiscountItems> targetGetter)
Parameters
Type Name Description
EPiServer.Framework.Localization.LocalizationService localizationService

The localization service.

System.Func<TEntryPromotion, DiscountItems> targetGetter

Delegate which picks the discount targets from a TEntryPromotion instance.

Methods

AddErrorsIfNeeded(TEntryPromotion, List<ValidationError>)

Declaration
protected override void AddErrorsIfNeeded(TEntryPromotion promotion, List<ValidationError> validationErrors)
Parameters
Type Name Description
TEntryPromotion promotion
System.Collections.Generic.List<EPiServer.Validation.ValidationError> validationErrors
Overrides
EPiServer.Commerce.Validation.PromotionDataValidatorBase<TEntryPromotion>.AddErrorsIfNeeded(TEntryPromotion, System.Collections.Generic.List<EPiServer.Validation.ValidationError>)

Implements

EPiServer.Validation.IValidate<>
EPiServer.Validation.IValidate

See Also