Class PriceCalculationResultItemBase<TProductIdentifier, TProductData>
Represents the result of calculating prices for a single item in an order.
public class PriceCalculationResultItemBase<TProductIdentifier, TProductData> : IPriceCalculationResultItem<TProductIdentifier, TProductData> where TProductIdentifier : ProductIdentifier where TProductData : ProductData, new()
Type Parameters
TProductIdentifierProduct data identifier type.
TProductDataProduct data type.
- Inheritance
-
objectPriceCalculationResultItemBase<TProductIdentifier, TProductData>
- Implements
-
IPriceCalculationResultItem<TProductIdentifier, TProductData>
- Derived
- Extension Methods
Remarks
Extend this class if you need to change the generic type of the product identifier. Extend PriceCalculationResultItem if you do not need to change the default identifier type of ProductIdentifier.
Constructors
PriceCalculationResultItemBase()
public PriceCalculationResultItemBase()
Properties
LineTotal
public decimal LineTotal { get; set; }
Property Value
- decimal
Remarks
ProductData
Product data used for the calculation and calculation result.
public TProductData ProductData { get; init; }
Property Value
- TProductData
ProductIdentifier
Unique identifier for the associated product in the cart. Used to link calculation logic to a specific cart item.
public TProductIdentifier ProductIdentifier { get; init; }
Property Value
- TProductIdentifier
Quantity
Quantity.
public decimal Quantity { get; set; }
Property Value
- decimal
Methods
SetProductData(ProductData)
Internal "setter" for the ProductData to enable to use contravariance "out" in the IPriceCalculationResultItem<TProductIdentifier, TProductData> interface to support inherited subclasses of ProductData in the IPriceCalculationResultItem<TProductIdentifier, TProductData> interface.
public void SetProductData(ProductData productData)
Parameters
productDataProductData