Table of Contents

Class ProductIdentifier

Namespace
CMS.Commerce
Assembly
CMS.Commerce.dll

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
object
ProductIdentifier
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

original ProductIdentifier

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

other ProductIdentifier

Returns

bool

Equals(object?)

public override bool Equals(object? obj)

Parameters

obj object

Returns

bool

GetHashCode()

public override int GetHashCode()

Returns

int

PrintMembers(StringBuilder)

protected virtual bool PrintMembers(StringBuilder builder)

Parameters

builder StringBuilder

Returns

bool

ToString()

public override string ToString()

Returns

string

Operators

operator ==(ProductIdentifier?, ProductIdentifier?)

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

Parameters

left ProductIdentifier
right ProductIdentifier

Returns

bool

operator !=(ProductIdentifier?, ProductIdentifier?)

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

Parameters

left ProductIdentifier
right ProductIdentifier

Returns

bool