Click or drag to resize

ResourceManagementClientDeleteResource Method (UniqueIdentifier)

Deletes the specified resource from the resource management service

Namespace:  Lithnet.ResourceManagement.Client
Assembly:  Lithnet.ResourceManagement.Client (in Lithnet.ResourceManagement.Client.dll) Version: 1.0.6435.24467
Syntax
public void DeleteResource(
	UniqueIdentifier id
)

Parameters

id
Type: UniqueIdentifier
The reference to the object to delete
Examples
The following example shows how to delete an object using a reference attribute
Example
public void DeleteResourceByReference()
{
    ResourceManagementClient client = new ResourceManagementClient();

    // Get the object with the reference to another object to delete
    ResourceObject resource = client.GetResourceByKey("Person", "AccountName", "user0001");

    if (resource == null)
    {
        return;
    }

    try
    {
        // Delete the object referenced by the 'Manager' attribute on person 'user00001';
        client.DeleteResource(resource.Attributes["Manager"].ReferenceValue);
    }
    catch (Exception)
    {
        // An error occurred while deleting the resource
        throw;
    }
}
See Also