Click or drag to resize

TagManagerByName Method

Retrieves a tag by its name.

Namespace:  Law.EdaIntegration.Tagging
Assembly:  Law.EdaIntegration (in Law.EdaIntegration.dll) Version: 7.2
Syntax
C#
public Tag ByName(
	string tagName
)

Parameters

tagName
Type: SystemString
The name of the tag to find.

Return Value

Type: Tag
The tag matching the supplied tag name.
Exceptions
ExceptionCondition
EdaApiExceptionThrown if a tag cannot be found with the specified name.
Examples
The following example demonstrates retrieving a tag using its name.
C#
using Law.EdaIntegration;
using Law.EdaIntegration.Case;
using Law.EdaIntegration.Tagging;

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

        // Create a new tag
        Tag tag = edaCase.Tags.Create("Privileged");
        Tag itemById = edaCase.Tags.ByName(tag.Name);
        Console.WriteLine("Id: {0}", itemById.Id);
        Console.WriteLine("Name: {0}", itemById.Name);
    }
}
/*
This example produces the following results:

Id: 1
Name: Privileged
 */
See Also