Click or drag to resize

ICustodianManagerDelete Method

Delete one more custodians
Caution note Caution
Deleting a custodian will also delete all the sources for each custodian, and by extension all the documents and metadata for those sources.

Namespace:  EdaIntegrationContract.Import
Assembly:  EdaIntegration.Contract (in EdaIntegration.Contract.dll) Version: 1.0
Syntax
C#
void Delete(
	List<int> custodianIdsToDelete
)

Parameters

custodianIdsToDelete
Type: System.Collections.GenericListInt32
The list of unique identifiers of the custodians to be deleted
Examples
This example demonstrates deleting a custodian.
C#
using EdaIntegrationContract;
using EdaIntegrationContract.Case;
using EdaIntegrationContract.Import;

class Sample
{
    public static void Main()
    {
        var edaIntegration = new EdaIntegration().ConnectToExplore();
        ICase edaCase = edaIntegration.Cases.OpenCaseByName("Case 1");

        // Retrieve an existing custodian
        ICustodian custodian = edaCase.Custodians.ByName("Custodian 3");
        Console.WriteLine("({0}) {1}", custodian.Id, custodian.Name);

        // Delete the custodian
        List<int> custodiansToDelete = new List<int> { custodian.Id };
        edaCase.Custodians.Delete(custodiansToDelete);
        Console.WriteLine("Custodian deleted");

        // Attempting to find the custodian again will fail
        try
        {
          custodian = edaCase.Custodians.ByName("Custodian 3");
        }
        catch (EdaApiException ex)
        {
          Console.WriteLine("Exception: {0}", ex.Message);
        }
    }
}
/*
This example produces the following results:

Id: 3,  Name: Custodian 3
Custodian deleted
Exception: A custodian with the specified Name does not exist - Custodan 3 
 */
See Also