| 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 public IDocument ById(
int id
)
Parameters
- id
- Type: SystemInt32
The unique identifier of the document to find
Return Value
Type:
IDocumentThe document with the supplied unique identifier
Exceptions Exception | Condition |
---|
EdaApiException | Thrown if a document cannot be found with the specified Id |
Examples
The following example demonstrates retrieving a document using its id.
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);
}
}
}
See Also