Class IShipmentExtensions
This class is intended to be used internally by EPiServer. We do not support any backward compatibility on this. Extension methods for IShipment
Inheritance
Inherited Members
Namespace: EPiServer.Commerce.Order.Internal
Assembly: Mediachase.Commerce.dll
Version: 13.30.0Syntax
public static class IShipmentExtensions
Methods
AddSkipCalculatingShippingRateFlag(IShipment)
Add skip calculating shipping rate flag for the given shipment.
Declaration
public static void AddSkipCalculatingShippingRateFlag(this IShipment shipment)
Parameters
Type | Name | Description |
---|---|---|
IShipment | shipment | The shipment. |
GetShipmentDiscount(IShipment)
Sets the ShipmentDiscount property of the IShipmentDiscountAmount implementation on the IShipment instance passed in. If IShipmentDiscountAmount is not implemented, , the default decimal value is returned.
Declaration
public static decimal GetShipmentDiscount(this IShipment shipment)
Parameters
Type | Name | Description |
---|---|---|
IShipment | shipment | The shipment. |
Returns
Type | Description |
---|---|
System.Decimal | The shipment discount. |
SetShipmentDiscount(IShipment, Decimal)
Sets the ShipmentDiscount property of the IShipmentDiscountAmount implementation on the IShipment instance passed in. If IShipmentDiscountAmount is not implemented, there is no action.
Declaration
public static void SetShipmentDiscount(this IShipment shipment, decimal value)
Parameters
Type | Name | Description |
---|---|---|
IShipment | shipment | The shipment. |
System.Decimal | value | The value to set. |
ShouldSkipCalculatingShippingRate(IShipment)
Verifies whether it skip calculating shipping rate for a shipment.
Declaration
public static bool ShouldSkipCalculatingShippingRate(this IShipment shipment)
Parameters
Type | Name | Description |
---|---|---|
IShipment | shipment | The shipment. |
Returns
Type | Description |
---|---|
System.Boolean |
|
TryGetDiscountValue(IShipment, Expression<Func<IShipmentDiscountAmount, Decimal>>)
Gets discount fields for shipment.
Declaration
public static decimal TryGetDiscountValue(this IShipment shipment, Expression<Func<IShipmentDiscountAmount, decimal>> property)
Parameters
Type | Name | Description |
---|---|---|
IShipment | shipment | The shipment. |
System.Linq.Expressions.Expression<System.Func<IShipmentDiscountAmount, System.Decimal>> | property | The getter function. |
Returns
Type | Description |
---|---|
System.Decimal |
TrySetDiscountValue(IShipment, Expression<Func<IShipmentDiscountAmount, Decimal>>, Decimal)
Updates the shipment discount with the following action.
Declaration
public static void TrySetDiscountValue(this IShipment shipment, Expression<Func<IShipmentDiscountAmount, decimal>> property, decimal value)
Parameters
Type | Name | Description |
---|---|---|
IShipment | shipment | The shipment. |
System.Linq.Expressions.Expression<System.Func<IShipmentDiscountAmount, System.Decimal>> | property | The property to set. |
System.Decimal | value | The value to set. |