Class PromotionCustomerEligibility
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
-
objectPromotionCustomerEligibility
- Extension Methods
Constructors
PromotionCustomerEligibility(string)
Initializes a new instance of the PromotionCustomerEligibility class.
public PromotionCustomerEligibility(string name)
Parameters
namestringThe name of the promotion customer eligibility.
Exceptions
- ArgumentException
Thrown when
nameis null or whitespace.
Properties
All
Promotion eligibility for all customers.
public static PromotionCustomerEligibility All { get; }
Property Value
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
Methods
Equals(PromotionCustomerEligibility)
Determines whether the specified promotion customer eligibility is equal to the current instance.
public bool Equals(PromotionCustomerEligibility other)
Parameters
otherPromotionCustomerEligibilityThe 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
objobject
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
Returns
- bool
operator !=(PromotionCustomerEligibility?, PromotionCustomerEligibility?)
public static bool operator !=(PromotionCustomerEligibility? left, PromotionCustomerEligibility? right)
Parameters
Returns
- bool