Class PromotionInformationRepository

PromotionInformation repository for the content promotion system.

Inheritance
System.Object
PromotionInformationRepository
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.Marketing
Assembly: Mediachase.Commerce.dll
Version: 10.8.0
Syntax
public class PromotionInformationRepository

Constructors

PromotionInformationRepository(ISynchronizedObjectInstanceCache, IContentLoader)

Initializes a new instance of the PromotionInformationRepository class.

Declaration
public PromotionInformationRepository(ISynchronizedObjectInstanceCache cache, IContentLoader contentLoader)
Parameters
Type Name Description
EPiServer.Framework.Cache.ISynchronizedObjectInstanceCache cache

The cache used for promotion redemptions.

EPiServer.IContentLoader contentLoader

The content loader used for finding all promotions belonging to a certain campaign.

Methods

Delete(Int32)

Deletes promotion informations for an order.

Declaration
public virtual void Delete(int orderFormId)
Parameters
Type Name Description
System.Int32 orderFormId

Order form id.

GetRedemptions(IEnumerable<Guid>)

Loads the redemption information of the given collection of promotions.

Declaration
public virtual IEnumerable<PromotionRedemption> GetRedemptions(IEnumerable<Guid> promotions)
Parameters
Type Name Description
System.Collections.Generic.IEnumerable<System.Guid> promotions

A collection of EPiServer.Core.ContentReferences representing the promotions to be fetched.

Returns
Type Description
System.Collections.Generic.IEnumerable<PromotionRedemption>

Information about the usage of each promotion for the provided customer.

GetRedemptions(IEnumerable<Guid>, Guid, Nullable<Int32>)

Loads redemption information of for the given collection of promotions and the given customer.

Declaration
public virtual IEnumerable<PromotionRedemption> GetRedemptions(IEnumerable<Guid> promotions, Guid customerId, int? orderFormId)
Parameters
Type Name Description
System.Collections.Generic.IEnumerable<System.Guid> promotions

A collection of EPiServer.Core.ContentReferences representing the promotions to be fetched.

System.Guid customerId

The customer identifier.

System.Nullable<System.Int32> orderFormId

An optional ID for the current order form which should be excluded in the resultset.

Returns
Type Description
System.Collections.Generic.IEnumerable<PromotionRedemption>

Information about the usage of each promotion for the provided customer.

Remarks

The loaded redemption information will not be cached.

GetRedemptionsFromDatabase(IEnumerable<Guid>, Nullable<Guid>, Nullable<Int32>)

Loads redemption information from the database.

Declaration
protected virtual IEnumerable<PromotionRedemption> GetRedemptionsFromDatabase(IEnumerable<Guid> promotions, Guid? customerId, int? orderFormId)
Parameters
Type Name Description
System.Collections.Generic.IEnumerable<System.Guid> promotions

A list of promotion ID:s that should be included in the result. An empty list will return all promotions.

System.Nullable<System.Guid> customerId

The customer identifier. Pass null value to return redemption information of all customers.

System.Nullable<System.Int32> orderFormId

An optional ID for the current order form which should be excluded in the resultset.

Returns
Type Description
System.Collections.Generic.IEnumerable<PromotionRedemption>

GetRedemptionsPerCampaign(ContentReference)

Loads the redemption information for all promotions belonging to the specified campaign.

Declaration
public virtual IEnumerable<PromotionRedemption> GetRedemptionsPerCampaign(ContentReference campaignLink)
Parameters
Type Name Description
EPiServer.Core.ContentReference campaignLink

The campaign link.

Returns
Type Description
System.Collections.Generic.IEnumerable<PromotionRedemption>

Information about the usage of each promotion in the campaign.

Load(IOrderForm)

Loads promotion information for an order.

Declaration
public IEnumerable<PromotionInformation> Load(IOrderForm orderForm)
Parameters
Type Name Description
IOrderForm orderForm

The related order form.

Returns
Type Description
System.Collections.Generic.IEnumerable<PromotionInformation>

Promotion information for the order form.

Save(IEnumerable<PromotionInformation>)

Saves a collection of PromotionInformations.

Declaration
public virtual void Save(IEnumerable<PromotionInformation> promotionInformations)
Parameters
Type Name Description
System.Collections.Generic.IEnumerable<PromotionInformation> promotionInformations

The promotion information to save.