November Happy Hour will be moved to Thursday December 5th.

Class ILineItemExtensions

Extensions method for ILineItem

Inheritance
System.Object
ILineItemExtensions
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: EPiServer.Commerce.Order.Internal
Assembly: Mediachase.Commerce.dll
Version: 12.17.2
Syntax
public static class ILineItemExtensions

Methods

GetEntryDiscountValue(ILineItem)

Gets the EntryAmount property of the ILineItemDiscountAmount implementation on the ILineItem instance passed in. If ILineItemDiscountAmount is not implemented, the default decimal value is returned.

Declaration
public static decimal GetEntryDiscountValue(this ILineItem lineItem)
Parameters
Type Name Description
ILineItem lineItem

The line item.

Returns
Type Description
System.Decimal

The entry discount amount.

GetOrderDiscountValue(ILineItem)

Gets the OrderAmount property of the ILineItemDiscountAmount implementation on the ILineItem instance passed in. If ILineItemDiscountAmount is not implemented, the default decimal value is returned.

Declaration
public static decimal GetOrderDiscountValue(this ILineItem lineItem)
Parameters
Type Name Description
ILineItem lineItem

The line item.

Returns
Type Description
System.Decimal

The order discount amount.

SetEntryDiscountValue(ILineItem, Decimal)

Sets the EntryAmount property of the ILineItemDiscountAmount implementation on the ILineItem instance passed in. If ILineItemDiscountAmount is not implemented, there is no action.

Declaration
public static void SetEntryDiscountValue(this ILineItem lineItem, decimal value)
Parameters
Type Name Description
ILineItem lineItem

The line item.

System.Decimal value

The value to set.

SetOrderDiscountValue(ILineItem, Decimal)

Sets the OrderAmount property of the ILineItemDiscountAmount implementation on the ILineItem instance passed in. If ILineItemDiscountAmount is not implemented, there is no action.

Declaration
public static void SetOrderDiscountValue(this ILineItem lineItem, decimal value)
Parameters
Type Name Description
ILineItem lineItem

The line item.

System.Decimal value

The value to set.

TryGetDiscountValue(ILineItem, Expression<Func<ILineItemDiscountAmount, Decimal>>)

Access to the line item discount amount writable properties.

Declaration
public static decimal TryGetDiscountValue(this ILineItem lineItem, Expression<Func<ILineItemDiscountAmount, decimal>> property)
Parameters
Type Name Description
ILineItem lineItem

The line item to be casted

System.Linq.Expressions.Expression<System.Func<ILineItemDiscountAmount, System.Decimal>> property

The property to get the value from.

Returns
Type Description
System.Decimal

The value from property.

TrySetDiscountValue(ILineItem, Expression<Func<ILineItemDiscountAmount, Decimal>>, Decimal)

Updates the line item discount with the following action.

Declaration
public static void TrySetDiscountValue(this ILineItem lineItem, Expression<Func<ILineItemDiscountAmount, decimal>> property, decimal value)
Parameters
Type Name Description
ILineItem lineItem

The line item.

System.Linq.Expressions.Expression<System.Func<ILineItemDiscountAmount, System.Decimal>> property

The property to set.

System.Decimal value

The value to set.