Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more

Class PromotionProcessorResolver

Finds the supported IPromotionProcessor type for a PromotionData, and returns an instance of that type.

Inheritance
System.Object
PromotionProcessorResolver
Namespace: EPiServer.Commerce.Marketing
Assembly: EPiServer.Business.Commerce.dll
Version: 14.26.0
Syntax
public class PromotionProcessorResolver : Object

Constructors

PromotionProcessorResolver(ITypeScannerLookup, IServiceProvider, TypeRelater)

Creates an instance of the PromotionProcessorResolver class.

Declaration
public PromotionProcessorResolver(ITypeScannerLookup typeScannerLookup, IServiceProvider serviceProvider, TypeRelater typeRelater)
Parameters
Type Name Description
EPiServer.Framework.TypeScanner.ITypeScannerLookup typeScannerLookup

The type scanner.

System.IServiceProvider serviceProvider

The Service provider.

EPiServer.Framework.TypeScanner.TypeRelater typeRelater

The type relater

Methods

GetPromotionProcessorTypesWithModelType()

List all registered IPromotionProcessor types with it's promotion data.

Declaration
protected IDictionary<Type, Type> GetPromotionProcessorTypesWithModelType()
Returns
Type Description
System.Collections.Generic.IDictionary<System.Type, System.Type>

A list of IPromotionProcessor types with it's promotion data

ResolveForPromotion(PromotionData)

Finds the supported IPromotionProcessor type for the PromotionData, and returns an instance of that type.

Declaration
public virtual IPromotionProcessor ResolveForPromotion(PromotionData promotionData)
Parameters
Type Name Description
PromotionData promotionData

The promotion model.

Returns
Type Description
IPromotionProcessor

Supported IPromotionProcessor if exist, otherwise null.

Exceptions
Type Condition
System.ArgumentNullException

promotion model is null.

System.NotImplementedException

The promotionData has no promotion processor.

ResolvePromotionProcessor(IList<Type>)

Gets a IPromotionProcessor instance for a type if the type implements IPromotionProcessor.

Declaration
public virtual IPromotionProcessor ResolvePromotionProcessor(IList<Type> promotionProcessorTypes)
Parameters
Type Name Description
System.Collections.Generic.IList<System.Type> promotionProcessorTypes

The collection of IPromotionProcessor types.

Returns
Type Description
IPromotionProcessor

IPromotionProcessor if the type is a promotion processor type.

Exceptions
Type Condition
System.InvalidOperationException

The type is not a promotion processor type.

System.ArgumentNullException

The promotion processor type is null.