Click or drag to resize

DocumentManagerById Method (IEnumerableInt32)

Retrieves a set of documents matching a list of unique identifiers

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

Parameters

documentIds
Type: System.Collections.GenericIEnumerableInt32
The unique identifiers of the documents to find

Return Value

Type: IEnumerableIDocument
A list of documents matching the supplied unique identifiers
Examples
The following example demonstrates retrieving multiple documents using a list of ids.
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");

        // Retrieve all documents that have exceptions
        int[] docIds = edaCase.Exceptions.All().Select(x => x.DocumentId).ToArray();
        IDocument[] docs = edaCase.Documents.ById(docIds).ToArray();

        // Print the document id and name
        Console.WriteLine("All documents with exceptions");
        Console.WriteLine("=============================");
        foreach (IDocument doc in docs)
        {
            if (doc.DocumentType == DocumentType.EDocument)
            {
                Console.WriteLine("{0,6}  {1, -25}", doc.Id, doc.FileName);
            }
            else if (doc.DocumentType == DocumentType.Email)
            {
                Console.WriteLine("{0,6}  {1, -25}", doc.Id, doc.EmailMetadata.Subject);
            }
        }
    }
}
/*
This example produces the following results:

All documents with exceptions
======================================
    26  Doc1_metadata.docm
     6  Empty Content.rtf
    22  early.docx
    15  lorem_pw.docx
     3  Custom Encrypted.pptx
     1  Background.jpg
     7  nashvile march.jpg*/
See Also