TryGetSku Method (String, 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, _
variantId As String, _
<OutAttribute> ByRef inventorySku As InventorySku _
) As Boolean
'Usage
Dim instance As InventorySkuCollection
Dim productCatalogName As String
Dim productId As String
Dim variantId As String
Dim inventorySku As InventorySku
Dim returnValue As Boolean
returnValue = instance.TryGetSku(productCatalogName, _
productId, variantId, inventorySku)
public bool TryGetSku(
string productCatalogName,
string productId,
string variantId,
out InventorySku inventorySku
)
public:
bool TryGetSku(
String^ productCatalogName,
String^ productId,
String^ variantId,
[OutAttribute] InventorySku^% inventorySku
)
public function TryGetSku(
productCatalogName : String,
productId : String,
variantId : String,
inventorySku : InventorySku
) : boolean
Parameters
- productCatalogName
Type: System..::.String
The name of the mapped product catalog.
- productId
Type: System..::.String
The product identifier.
- variantId
Type: System..::.String
The variant identifier.
- inventorySku
Type: Microsoft.CommerceServer.Inventory..::.InventorySku%
The InventorySku object for the specified Inventory SKU if the inventory SKU exists in the collection.
Return Value
Type: System..::.Boolean
true if the specified variantId 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
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.