Click or drag to resize

DocumentManagerById Method (Int32)

Retrieves a Document by its unique identifier

Namespace:  Law.EdaIntegration.Document
Assembly:  Law.EdaIntegration (in Law.EdaIntegration.dll) Version: 7.2
Syntax
C#
public IDocument ById(
	int id
)

Parameters

id
Type: SystemInt32
The unique identifier of the document to find

Return Value

Type: IDocument
The document with the supplied unique identifier
Exceptions
ExceptionCondition
EdaApiExceptionThrown if a document cannot be found with the specified Id
Examples
The following example demonstrates retrieving a document using its id.
C#
using Law.EdaIntegration;
using Law.EdaIntegration.Case;
using Law.EdaIntegration.Document;

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");
        IDocument doc = edaCase.Documents.ById(15);
        Console.WriteLine("Id: {0}", doc.Id);
        if (doc.DocumentType == DocumentType.EDocument)
        {
            Console.WriteLine("File Name: {0}", doc.FileName);
        }
        else if (doc.DocumentType == DocumentType.Email)
        {
            Console.WriteLine("Subject: {0}", doc.EmailMetadata.Subject);
        }
    }
}
/*
This example produces the following results:

Id: 15
Name: lorem_pw.docx
 */
See Also