Поделиться через


EntityInUseException Class

For the latest version of Commerce Server 2007 Help, see the Microsoft Web site.

The exception that is thrown when an entity is in use and an attempt to delete the entity occurs.

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

Syntax

'Declaration
<SerializableAttribute> _
Public Class EntityInUseException _
    Inherits CatalogException
'Usage
Dim instance As EntityInUseException
[SerializableAttribute]
public class EntityInUseException : CatalogException
[SerializableAttribute]
public ref class EntityInUseException : public CatalogException
public class EntityInUseException extends CatalogException

Remarks

All catalog exceptions, including the EntityInUseException are derived from the CatalogException class. The entity cannot be deleted as it is in use.

Examples

// Deletes the property from the catalog system
internal void DeleteProperty(string propertyName)
{
  try
  {
    catalogContext.DeleteProperty(propertyName);
  }
  catch (EntityDoesNotExistException ex)
  {
    // The property does not exist
    Console.WriteLine(ex.Message);
  }
  catch (EntityInUseException ex)
  {
    // The property is in use and cannot be deleted
    Console.WriteLine(ex.Message);
  }
}

Inheritance Hierarchy

System..::.Object
  System..::.Exception
    Microsoft.CommerceServer.Catalog..::.CatalogException
      Microsoft.CommerceServer.Catalog..::.EntityInUseException

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

EntityInUseException Members

Microsoft.CommerceServer.Catalog Namespace