Click or drag to resize

ExceptionManagerCountsByType Method

Retrieves the count of exceptions for each exception type that meets an optionally supplied set of filter criteria. If no filters are supplied then counts are returned for each exception type for which exceptions occurred.

Namespace:  Law.EdaIntegration.Exceptions
Assembly:  Law.EdaIntegration (in Law.EdaIntegration.dll) Version: 7.3
Syntax
C#
public List<KeyValuePair<ExceptionType, int>> CountsByType(
	ExceptionFilter filter = null
)

Parameters

filter (Optional)
Type: Law.EdaIntegration.ExceptionsExceptionFilter
The filters to apply to limit the exception values returned

Return Value

Type: ListKeyValuePairExceptionType, Int32
A key/value pair representing the exception type (key) and the number of exceptions that occurred for that type (value).
Examples
The following example demonstrates retrieving the count of exceptions for all exception types.
C#
using Law.EdaIntegration;
using Law.EdaIntegration.Case;
using Law.EdaIntegration.Exceptions;

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");

        Console.WriteLine("Exceptions with counts");
        Console.WriteLine("======================");
        foreach (KeyValuePair<ExceptionType, int> kvp in edaCase.Exceptions.CountsByType())
        {
            Console.WriteLine("{0, -16}  {1, 4}", kvp.Key, kvp.Value);
        }
    }
}
/*
This example produces the following results:

Exceptions with counts
======================
EmptyFile            1
EncryptedFile        4
NoContent           10
UnknownFileType      1
 */
See Also