Export (0) Print
Expand All

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)

[SerializableAttribute]
public class EntityInUseException : CatalogException

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

// 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);
  }
}

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

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