Share via


ApplyProductFilter Method

Filters a DiscountItemCollection for a specific product.

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

Syntax

'Declaration
Public Function ApplyProductFilter ( _
    filter As DiscountCriteriaFilter, _
    catalogName As String, _
    productId As String _
) As DiscountItemCollection
'Usage
Dim instance As DiscountItemCollection
Dim filter As DiscountCriteriaFilter
Dim catalogName As String
Dim productId As String
Dim returnValue As DiscountItemCollection

returnValue = instance.ApplyProductFilter(filter, _
    catalogName, productId)
public DiscountItemCollection ApplyProductFilter(
    DiscountCriteriaFilter filter,
    string catalogName,
    string productId
)
public:
DiscountItemCollection^ ApplyProductFilter(
    DiscountCriteriaFilter^ filter, 
    String^ catalogName, 
    String^ productId
)
public function ApplyProductFilter(
    filter : DiscountCriteriaFilter, 
    catalogName : String, 
    productId : String
) : DiscountItemCollection

Parameters

  • catalogName
    Type: System..::.String
    The name of the catalog to which the product belongs. Cannot be nullNothingnullptra null reference (Nothing in Visual Basic).
  • productId
    Type: System..::.String
    The name of the product to filter on. Cannot be nullNothingnullptra null reference (Nothing in Visual Basic).

Return Value

Type: Microsoft.CommerceServer.Runtime.Marketing..::.DiscountItemCollection
A new filtered DiscountItemCollection.

Exceptions

Exception Condition
ArgumentNullException

Any of the input parameters are nullNothingnullptra null reference (Nothing in Visual Basic).

Remarks

Creates and returns a DiscountItemCollection, the original DiscountItemCollection filtered by a product. The newly created DiscountItemCollection contains only DiscountItem object with the specified productId.

A product is uniquely identified by its name and the name of the catalog to which it belongs. Additional filter settings can be specified by setting the corresponding properties on the DiscountCriteriaFilter input parameter. The existing DiscountItemCollection is not modified by this method.

Permissions

See Also

Reference

DiscountItemCollection Class

DiscountItemCollection Members

Microsoft.CommerceServer.Runtime.Marketing Namespace