Share via


Remove Method (LineItem)

Removes the first occurrence of the specified LineItem from the current collection.

Namespace:  Microsoft.CommerceServer.Runtime.Orders
Assembly:  Microsoft.CommerceServer.Runtime (in Microsoft.CommerceServer.Runtime.dll)

Syntax

'Declaration
Public Sub Remove ( _
    lineItem As LineItem _
)
'Usage
Dim instance As LineItemCollection
Dim lineItem As LineItem

instance.Remove(lineItem)
public void Remove(
    LineItem lineItem
)
public:
void Remove(
    LineItem^ lineItem
)
public function Remove(
    lineItem : LineItem
)

Parameters

Exceptions

Exception Condition
ArgumentNullException

lineItem is nullNothingnullptra null reference (Nothing in Visual Basic).

Remarks

Removes a specified LineItem from the collection. When a LineItem is removed from the collection, all subsequent LineItem objects move up one index in the collection and the collection count is decremented.

If there are no line items in the collection, the function returns with no exception.

When this operation is performed, the LastModified property is updated. LastModified is not updated when there are no line items or an exception is thrown.

Remove also updates the Index property for all the remaining line items and places them accordingly in the line item collection.

Permissions

See Also

Reference

LineItemCollection Class

LineItemCollection Members

Remove Overload

Microsoft.CommerceServer.Runtime.Orders Namespace