DeleteDefinition Method (String, Boolean)
Deletes an existing product or category definition. Allows force deleting the definition if it is used in one or more catalogs.
Namespace: Microsoft.CommerceServer.Catalog
Assembly: Microsoft.CommerceServer.Catalog (in Microsoft.CommerceServer.Catalog.dll)
Syntax
'Declaration
Public Sub DeleteDefinition ( _
definitionName As String, _
forceDelete As Boolean _
)
'Usage
Dim instance As CatalogContext
Dim definitionName As String
Dim forceDelete As Boolean
instance.DeleteDefinition(definitionName, _
forceDelete)
public void DeleteDefinition(
string definitionName,
bool forceDelete
)
public:
void DeleteDefinition(
String^ definitionName,
bool forceDelete
)
public function DeleteDefinition(
definitionName : String,
forceDelete : boolean
)
Parameters
- definitionName
Type: System..::.String
The definition to delete. Should not be nullNothingnullptra null reference (Nothing in Visual Basic).
- forceDelete
Type: System..::.Boolean
Set this parameter to true to force delete a definition; Otherwise, false.
Remarks
This method deletes the definition from the catalog system. If forceDelete is true then this method will delete all the products and categories using this definition in existing catalogs and remove the definition from the catalog system.
Examples
This example describes how to force delete a definition from the catalog system.
private void DeleteDefinition(CatalogContext catalogContext, string definitionName)
{
catalogContext.DeleteDefinition(definitionName, true);
}
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.