다음을 통해 공유


TryGetSku Method (String, String, InventorySku)

Returns a value indicating if the specified InventorySku is within the InventorySkuCollection. This method also returns the specified InventorySku.

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

Syntax

'Declaration
Public Function TryGetSku ( _
    productCatalogName As String, _
    productId As String, _
    <OutAttribute> ByRef inventorySku As InventorySku _
) As Boolean
'Usage
Dim instance As InventorySkuCollection
Dim productCatalogName As String
Dim productId As String
Dim inventorySku As InventorySku
Dim returnValue As Boolean

returnValue = instance.TryGetSku(productCatalogName, _
    productId, inventorySku)
public bool TryGetSku(
    string productCatalogName,
    string productId,
    out InventorySku inventorySku
)
public:
bool TryGetSku(
    String^ productCatalogName, 
    String^ productId, 
    [OutAttribute] InventorySku^% inventorySku
)
public function TryGetSku(
    productCatalogName : String, 
    productId : String, 
    inventorySku : InventorySku
) : boolean

Parameters

Return Value

Type: System..::.Boolean
true if the inventory SKU exists in the collection; otherwise false.

Remarks

Returns the InventorySku object for the specified inventory SKU if the inventory catalog exists in the collection. This method returns to true if the inventory catalog exists in the collection false if the inventory SKU does not exist in the collection. If this method returns false then the inventorySku object will be nullNothingnullptra null reference (Nothing in Visual Basic).

Permissions

See Also

Reference

InventorySkuCollection Class

InventorySkuCollection Members

TryGetSku Overload

Microsoft.CommerceServer.Inventory Namespace