Click or drag to resize

CustodianManagerDelete 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:  Law.EdaIntegration.Import
Assembly:  Law.EdaIntegration (in Law.EdaIntegration.dll) Version: 7.3
Syntax
C#
public 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 Law.EdaIntegration;
using Law.EdaIntegration.Case;
using Law.EdaIntegration.Import;

class Sample
{
    public static void Main()
    {
        string connectionString = @"Data Source=localhost;Initial Catalog=EDA_Management;Integrated Security=False;User ID=myUserId;Password=myPassword";
        EdaIntegration edaIntegration = new EdaIntegration();
        edaIntegration.InitializeEnvironment(connectionString);

        Case edaCase = edaIntegration.Cases.OpenCaseByName("Case 1");

        // Retrieve an existing custodian
        Custodian 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