Table of Contents

Class PromotionCustomerEligibility

Namespace
CMS.Commerce
Assembly
CMS.Commerce.dll

Represents the customer eligibility requirement for a promotion. This value determines which customers can use the promotion (all visitors or registered members only).

public sealed record PromotionCustomerEligibility
Inheritance
object
PromotionCustomerEligibility
Extension Methods

Constructors

PromotionCustomerEligibility(string)

Initializes a new instance of the PromotionCustomerEligibility class.

public PromotionCustomerEligibility(string name)

Parameters

name string

The name of the promotion customer eligibility.

Exceptions

ArgumentException

Thrown when name is null or whitespace.

Properties

All

Promotion eligibility for all customers.

public static PromotionCustomerEligibility All { get; }

Property Value

PromotionCustomerEligibility

Name

Name of the promotion customer eligibility.

public string Name { get; }

Property Value

string

Registered

Promotion eligibility for registered members only.

public static PromotionCustomerEligibility Registered { get; }

Property Value

PromotionCustomerEligibility

Methods

Equals(PromotionCustomerEligibility)

Determines whether the specified promotion customer eligibility is equal to the current instance.

public bool Equals(PromotionCustomerEligibility other)

Parameters

other PromotionCustomerEligibility

The promotion customer eligibility to compare with the current instance.

Returns

bool

true if the specified promotion customer eligibility is equal to the current instance; otherwise, false.

Equals(object?)

public override bool Equals(object? obj)

Parameters

obj object

Returns

bool

GetHashCode()

Returns the hash code for the promotion customer eligibility.

public override int GetHashCode()

Returns

int

A hash code for the current promotion customer eligibility.

ToString()

Returns a string representation of the promotion customer eligibility.

public override string ToString()

Returns

string

The name of the promotion customer eligibility.

Operators

operator ==(PromotionCustomerEligibility?, PromotionCustomerEligibility?)

public static bool operator ==(PromotionCustomerEligibility? left, PromotionCustomerEligibility? right)

Parameters

left PromotionCustomerEligibility
right PromotionCustomerEligibility

Returns

bool

operator !=(PromotionCustomerEligibility?, PromotionCustomerEligibility?)

public static bool operator !=(PromotionCustomerEligibility? left, PromotionCustomerEligibility? right)

Parameters

left PromotionCustomerEligibility
right PromotionCustomerEligibility

Returns

bool