OrderItem
Class public
Represents a single line item within an Order, capturing the product, quantity, and price at the time of purchase.
Definition
Section titled Definitionpublic class OrderItemRemarks
Section titled RemarksPrices are captured at order time and do not change if the product's catalogue price is updated later. The line total can be calculated as
Quantity * UnitPrice.Properties3
Section titled PropertiesProductName Section titled ProductName string string OrderItem.ProductNameGets or sets the display name of the product being ordered.
Remarks
This is a snapshot of the product name at order time. It is stored denormalized so that the order remains readable even if the product is renamed or removed from the catalogue.
Quantity Section titled Quantity int int OrderItem.QuantityGets or sets the number of units ordered.
Remarks
Must be a positive integer. Defaults to 1.
UnitPrice Section titled UnitPrice decimal decimal OrderItem.UnitPriceGets or sets the unit price of the product at the time the order was placed.
Remarks
Stored as a
Decimal to avoid floating-point rounding errors in financial calculations.