ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Core.Data.DDL Namespace / RangeDomainDescription Class / RangeDomainDescription Constructor / RangeDomainDescription Constructor(RangeDomain)
The ArcGIS.Core.Data.RangeDomain that the description object is representing.
Example

In This Topic
    RangeDomainDescription Constructor(RangeDomain)
    In This Topic
    Creates a description object of the ArcGIS.Core.Data.RangeDomain.
    Syntax
    Public Function New( _
       ByVal rangeDomain As RangeDomain _
    )
    public RangeDomainDescription( 
       RangeDomain rangeDomain
    )

    Parameters

    rangeDomain
    The ArcGIS.Core.Data.RangeDomain that the description object is representing.
    Exceptions
    ExceptionDescription
    rangeDomain is null.
    Example
    Delete Domain on KG Schemas with SchemaBuilder
    {
      await QueuedTask.Run(() =>
      {
        using (var kg = GetKnowledgeGraph(url))
        {
          //Get all the domains in the KG
          var domains = kg.GetDomains();
          var sb = new SchemaBuilder(kg);
    
          foreach (var domain in domains)
          {
            //skip the special provenance domain
            var name = domain.GetName();
            if (string.Compare(name, "esri__provenanceSourceType", true) == 0)
              continue;//skip this one
    
            //Delete all other domains
            if (domain is ArcGIS.Core.Data.RangeDomain rd)
              sb.Delete(new RangeDomainDescription(rd));
            else if (domain is ArcGIS.Core.Data.CodedValueDomain cvd)
              sb.Delete(new CodedValueDomainDescription(cvd));
          }
    
          try
          {
            //note: will throw an InvalidOperationException if there are no operations
            //to run. Will also delete associated fields dependent on deleted domain(s)
            if (!kg.ApplySchemaEdits(sb))
            {
              var err_msg = string.Join(",", sb.ErrorMessages.ToArray());
              System.Diagnostics.Debug.WriteLine($"Delete domains error: {err_msg}");
            }
          }
          catch (Exception ex)
          {
            System.Diagnostics.Debug.WriteLine(ex.ToString());
          }
        }
      });
    }
    
    KnowledgeGraph GetKnowledgeGraph(string url)
    {
      var kg_props =
        new KnowledgeGraphConnectionProperties(new Uri(url));
      return new KnowledgeGraph(kg_props);
    }
    Requirements

    Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)

    ArcGIS Pro version: 3.0 or higher.
    See Also