ArcGIS Pro 3.8 API Reference Guide
ArcGIS.Core.Data.DDL Namespace / CodedValueDomainDescription Class / CodedValuePairs Property
Example

In This Topic
    CodedValuePairs Property
    In This Topic
    Returns the SortedList of coded value pairs.
    Syntax
    public SortedList<object,string> CodedValuePairs {get;}
    Public ReadOnly Property CodedValuePairs As SortedList(Of Object,String)
    Example
    Modifying domain
    {
      Task ModifyDomainAsync(Geodatabase geodatabase, string codedValueDomainName = "Pipe") => QueuedTask.Run(() =>
      {
        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 Home, Pro, Enterprise (64 bit)

    ArcGIS Pro version: 3.0 or higher.
    See Also