ArcGIS Pro 3.4 API Reference Guide
ArcGIS.Core.Data.DDL Namespace / SchemaBuilder Class / Modify Method / Modify(CodedValueDomainDescription,SortBy,SortOrder) Method
Indicates the ArcGIS.Core.Data.CodedValueDomain to be modified.
Indicates the parameter by which to sort.
Indicates whether the coded value pairs should be sorted in ascending or descending order.
Example

In This Topic
    Modify(CodedValueDomainDescription,SortBy,SortOrder) Method
    In This Topic
    Enqueue the modify operation on the object referred to by the CodedValueDomainDescription. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax

    Parameters

    codedValueDomainDescription
    Indicates the ArcGIS.Core.Data.CodedValueDomain to be modified.
    sortBy
    Indicates the parameter by which to sort.
    sortOrder
    Indicates whether the coded value pairs should be sorted in ascending or descending order.
    Exceptions
    Example
    Modifying domain
    public void ModifyDomain(Geodatabase geodatabase, string codedValueDomainName = "Pipe")
    {
        SchemaBuilder schemaBuilder = new SchemaBuilder(geodatabase);
        CodedValueDomain codedValueDomain = geodatabase.GetDomains().First(f => f.GetName().Equals(codedValueDomainName)) as CodedValueDomain;
        CodedValueDomainDescription codedValueDomainDescription = new CodedValueDomainDescription(codedValueDomain);
    
        // Update domain description
        codedValueDomainDescription.Description = "Water Pipe Domain";
    
        // Adding code/value pair
        codedValueDomainDescription.CodedValuePairs.Add("C", "Copper");
    
        schemaBuilder.Modify(codedValueDomainDescription);
    
        // To modify the orders of coded value domain
        // schemaBuilder.Modify(codedValueDomainDescription,SortBy.Name,SortOrder.Ascending);
    
        schemaBuilder.Build();
    }
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3.1 or higher.
    See Also