Class ProductIdentifier
Represents a unique identifier for a product in the cart. Used to associate calculation logic with a specific cart item and with items in calculation requests and results.
public record ProductIdentifier
- Inheritance
-
objectProductIdentifier
- Extension Methods
Remarks
If you need to extend the identifier, inherit from this record and add additional properties to the identifier like product variant identifier.
Constructors
ProductIdentifier()
public ProductIdentifier()
ProductIdentifier(ProductIdentifier)
protected ProductIdentifier(ProductIdentifier original)
Parameters
originalProductIdentifier
Properties
EqualityContract
protected virtual Type EqualityContract { get; }
Property Value
- Type
Identifier
Identifier for the associated product in the cart. Used to link calculation logic to a specific cart item.
public int Identifier { get; init; }
Property Value
- int
Methods
Equals(ProductIdentifier?)
public virtual bool Equals(ProductIdentifier? other)
Parameters
otherProductIdentifier
Returns
- bool
Equals(object?)
public override bool Equals(object? obj)
Parameters
objobject
Returns
- bool
GetHashCode()
public override int GetHashCode()
Returns
- int
PrintMembers(StringBuilder)
protected virtual bool PrintMembers(StringBuilder builder)
Parameters
builderStringBuilder
Returns
- bool
ToString()
public override string ToString()
Returns
- string
Operators
operator ==(ProductIdentifier?, ProductIdentifier?)
public static bool operator ==(ProductIdentifier? left, ProductIdentifier? right)
Parameters
leftProductIdentifierrightProductIdentifier
Returns
- bool
operator !=(ProductIdentifier?, ProductIdentifier?)
public static bool operator !=(ProductIdentifier? left, ProductIdentifier? right)
Parameters
leftProductIdentifierrightProductIdentifier
Returns
- bool