November Happy Hour will be moved to Thursday December 5th.

Class GeographicCriterionBase<T>

Base class for geographic criteria

Inheritance
System.Object
GeographicCriterionBase<T>
Namespace: EPiServer.Personalization.VisitorGroups.Criteria
Assembly: EPiServer.Cms.AspNetCore.dll
Version: 12.0.3
Syntax
public abstract class GeographicCriterionBase<T> : CriterionBase<T>, ICriterion, IGeneratesAdministrativeInterface, ICriterionAvailability where T : class, ICriterionModel, new()
Type Parameters
Name Description
T

Constructors

GeographicCriterionBase()

Initializes an instance of GeographicCriterionBase<T>.

Declaration
public GeographicCriterionBase()

GeographicCriterionBase(IClientGeolocationResolver)

Initializes a new instance of the GeographicCriterionBase<T> class.

Declaration
public GeographicCriterionBase(IClientGeolocationResolver geolocationResolver)
Parameters
Type Name Description
IClientGeolocationResolver geolocationResolver

GeographicCriterionBase(IGeolocationProvider)

Initializes an instance of GeographicCriterionBase<T>.

Declaration
public GeographicCriterionBase(IGeolocationProvider geolocationProvider)
Parameters
Type Name Description
IGeolocationProvider geolocationProvider

GeographicCriterionBase(IGeolocationProvider, IPAddressResolver)

Initializes a new instance of the GeographicCriterionBase<T> class.

Declaration
public GeographicCriterionBase(IGeolocationProvider geolocationProvider, IPAddressResolver addressResolver)
Parameters
Type Name Description
IGeolocationProvider geolocationProvider

The geolocation provider.

IPAddressResolver addressResolver

The address resolver.

Properties

AvailableForCreation

Gets a value indicating whether this is enabled for creation as a criterion type from the user interface.

Declaration
public virtual bool AvailableForCreation { get; }
Property Value
Type Description
System.Boolean

true if enabled; otherwise, false.

GeolocationProvider

Returns the configured geolocation provider.

Declaration
protected IGeolocationProvider GeolocationProvider { get; }
Property Value
Type Description
IGeolocationProvider

Methods

HasCapabilities(Capabilities, Capabilities)

Checks whether a set of capabilities are available

Declaration
protected bool HasCapabilities(Capabilities capabilities, Capabilities capabilitiesMask)
Parameters
Type Name Description
Capabilities capabilities

The available capabilities

Capabilities capabilitiesMask

The capabilities to check for

Returns
Type Description
System.Boolean

true if the specified capabilities are available; otherwise, false.

IsMatch(IGeolocationResult, Capabilities)

Abstract method which should determine if the location of the client matches the location in settings

Declaration
protected abstract bool IsMatch(IGeolocationResult location, Capabilities capabilities)
Parameters
Type Name Description
IGeolocationResult location

The location of the client

Capabilities capabilities

The capabilities of the geolocation provider

Returns
Type Description
System.Boolean

true if the looked up location matches the settings; otherwise, false.

IsMatch(IPrincipal, HttpContext)

Determines whether the specified principal is match. Will look up the geolocation based on client IP and call a method in derived class to determine if location matches.

Declaration
public override sealed bool IsMatch(IPrincipal principal, HttpContext httpContext)
Parameters
Type Name Description
System.Security.Principal.IPrincipal principal

The principal.

Microsoft.AspNetCore.Http.HttpContext httpContext

The HTTP context.

Returns
Type Description
System.Boolean

true if the specified principal is match; otherwise, false.

Overrides
EPiServer.Personalization.VisitorGroups.CriterionBase<T>.IsMatch(System.Security.Principal.IPrincipal, Microsoft.AspNetCore.Http.HttpContext)

Implements

Extension Methods