Try our conversational search powered by Generative AI!

Class CampaignVisitorGroupFilter

A filter that filters on if the current user is part of any visitor groups required by a campaign.

Inheritance
System.Object
CampaignVisitorGroupFilter
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: EPiServer.Business.Commerce.dll
Version: 13.30.0
Syntax
public class CampaignVisitorGroupFilter

Constructors

CampaignVisitorGroupFilter(ServiceAccessor<HttpContextBase>, IVisitorGroupRepository, IVisitorGroupRoleRepository, IContentLoader)

Initializes a new instance of the CampaignVisitorGroupFilter class.

Declaration
public CampaignVisitorGroupFilter(ServiceAccessor<HttpContextBase> httpContextAccessor, IVisitorGroupRepository visitorGroupRepository, IVisitorGroupRoleRepository visitorGroupRoleRepository, IContentLoader contentLoader)
Parameters
Type Name Description
EPiServer.ServiceLocation.ServiceAccessor<System.Web.HttpContextBase> httpContextAccessor

Accessor to get the current http context.

EPiServer.Personalization.VisitorGroups.IVisitorGroupRepository visitorGroupRepository

Repository used to load visitor groups.

EPiServer.Personalization.VisitorGroups.IVisitorGroupRoleRepository visitorGroupRoleRepository

Repository needed to validate if a principal belongs to a visitor group.

EPiServer.IContentLoader contentLoader

The content loader.

Methods

Filter(PromotionFilterContext)

Filters campaigns on if the current user belongs to any of the required visitor groups.

Declaration
public virtual PromotionFilterContext Filter(PromotionFilterContext filterContext)
Parameters
Type Name Description
PromotionFilterContext filterContext

The filter context.

Returns
Type Description
PromotionFilterContext

The same PromotionFilterContext after filtering and adding applied visitor groups.