Share via


Item Property (String)

Gets the specified Product or ProductFamily object from the collection, identified by key. In C#, this property is the indexer for the ProductCollection class.

Namespace:  Microsoft.CommerceServer.Catalog
Assembly:  Microsoft.CommerceServer.Catalog (in Microsoft.CommerceServer.Catalog.dll)

Syntax

'Declaration
Public Overrides ReadOnly Property Item ( _
    productId As String _
) As Product
'Usage
Dim instance As ProductCollection
Dim productId As String
Dim value As Product

value = instance.Item(productId)
public override Product Item[
    string productId
] { get; }
public:
virtual property Product^ Item[String^ productId] {
    Product^ get (String^ productId) override;
}
JScript does not support indexed properties.

Parameters

  • productId
    Type: System..::.String
    An expression that specifies the key value of a member of the collection. The name of the object to find.

Property Value

Type: Microsoft.CommerceServer.Catalog..::.Product
A reference to a specified object from the ProductCollection.

Exceptions

Exception Condition
EntityDoesNotExistException

Thrown if no product in the collection's current page has ID productId.

Remarks

If productId doesn't match any existing member of the collection, an error occurs.

If an object exists within the collection that matches the productId, it is returned.

This property is the indexer for the ProductCollection class. The Item property allows for accessing the ProductCollection by productId.

Permissions

See Also

Reference

ProductCollection Class

ProductCollection Members

Item Overload

Microsoft.CommerceServer.Catalog Namespace