Class CollectionTargetEvaluator
Used by the promotion processors to identify which of the ILineItem that are included in the target property (that is exposed as an System.Collections.Generic.IEnumerable<T>).
Inheritance
Inherited Members
Namespace: EPiServer.Commerce.Marketing
Assembly: EPiServer.Business.Commerce.dll
Version: 13.30.0Syntax
public class CollectionTargetEvaluator
Constructors
CollectionTargetEvaluator(IContentLoader, IRelationRepository, ReferenceConverter)
Creates an instance of CollectionTargetEvaluator.
Declaration
[Obsolete("Use the other constructor with ISynchronizedObjectInstanceCache instead. This will be removed in the next major version.")]
public CollectionTargetEvaluator(IContentLoader contentLoader, IRelationRepository relationRepository, ReferenceConverter referenceConverter)
Parameters
Type | Name | Description |
---|---|---|
EPiServer.IContentLoader | contentLoader | The content loader service. |
IRelationRepository | relationRepository | The relation repository service. |
ReferenceConverter | referenceConverter | The reference converter service. |
CollectionTargetEvaluator(IContentLoader, IRelationRepository, ReferenceConverter, ISynchronizedObjectInstanceCache, MarketingOptions, IContentCacheKeyCreator)
Creates an instance of CollectionTargetEvaluator.
Declaration
public CollectionTargetEvaluator(IContentLoader contentLoader, IRelationRepository relationRepository, ReferenceConverter referenceConverter, ISynchronizedObjectInstanceCache objectInstanceCache, MarketingOptions marketingOptions, IContentCacheKeyCreator contentCacheKeyCreator)
Parameters
Type | Name | Description |
---|---|---|
EPiServer.IContentLoader | contentLoader | The content loader service. |
IRelationRepository | relationRepository | The relation repository service. |
ReferenceConverter | referenceConverter | The reference converter service. |
EPiServer.Framework.Cache.ISynchronizedObjectInstanceCache | objectInstanceCache | The object instance cache. |
MarketingOptions | marketingOptions | The marketing options. |
EPiServer.Core.IContentCacheKeyCreator | contentCacheKeyCreator | The content cache key creator. |
Methods
GetApplicableCodes(IEnumerable<ILineItem>, IEnumerable<ContentReference>, Boolean)
Gets all applicable Codes in the order by the targets in the promotion
Declaration
public virtual IList<string> GetApplicableCodes(IEnumerable<ILineItem> lineItemsInOrder, IEnumerable<ContentReference> targets, bool matchRecursive)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<ILineItem> | lineItemsInOrder | The line items in the order |
System.Collections.Generic.IEnumerable<EPiServer.Core.ContentReference> | targets | The target items for which the promotion is valid. |
System.Boolean | matchRecursive | Determines if a recursive logic should be used when identifying if an item is applicable for this promotion. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IList<System.String> | One Code for each ILineItem in lineItemsInOrder that matches any promotion target. |
GetMatchingCodes(IEnumerable<String>, IEnumerable<ContentReference>, Boolean)
Gets all matching codes of line items in the order by the targets in the promotion
Declaration
public virtual IList<string> GetMatchingCodes(IEnumerable<string> codes, IEnumerable<ContentReference> targets, bool matchRecursive)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<System.String> | codes | The line items in the order |
System.Collections.Generic.IEnumerable<EPiServer.Core.ContentReference> | targets | The target items for which the promotion is valid. |
System.Boolean | matchRecursive | Determines if a recursive logic should be used when identifying if an item is applicable for this promotion. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IList<System.String> | One Code for each ILineItem in lineItemsInOrder that matches any promotion target. |