ArcGIS Pro 3.3 API Reference Guide
ArcGIS.Core.Data.DDL Namespace / RangeDomainDescription Class / RangeDomainDescription Constructor / RangeDomainDescription Constructor(String,FieldType,Object,Object)
The name of the description.
The ArcGIS.Core.Data.FieldType of the description.
The minimum value for the range.
The maximum value for the range.
Example Version

    RangeDomainDescription Constructor(String,FieldType,Object,Object)
    Creates a description object of the ArcGIS.Core.Data.RangeDomain.
    Syntax
    public RangeDomainDescription( 
       string name,
       FieldType fieldType,
       object minValue,
       object maxValue
    )

    Parameters

    name
    The name of the description.
    fieldType
    The ArcGIS.Core.Data.FieldType of the description.
    minValue
    The minimum value for the range.
    maxValue
    The maximum value for the range.
    Exceptions
    ExceptionDescription

    name is invalid.

    -or-

    fieldType is invalid. The only valid types are ArcGIS.Core.Data.FieldType.SmallInteger, ArcGIS.Core.Data.FieldType.Integer, ArcGIS.Core.Data.FieldType.Single, ArcGIS.Core.Data.FieldType.Double, and ArcGIS.Core.Data.FieldType.Date.

    -or-

    The type of minValue and/or maxValue is invalid. The expected type for ArcGIS.Core.Data.FieldType.Date is System.DateTime. The expected type for ArcGIS.Core.Data.FieldType.SmallInteger and ArcGIS.Core.Data.FieldType.Integer is an integer. The expected type for ArcGIS.Core.Data.FieldType.Single and ArcGIS.Core.Data.FieldType.Double is a float.

    -or-

    minValue should be larger than maxValue.

    minValue and/or maxValue are null.
    The System.DateTime object is representing a year earlier than the year 100 AD.
    Example
    Creating a Range domain
    public void CreateRangeDomainSnippet(Geodatabase geodatabase)
    {
      // Create a range description with minimum value = 0 and maximum value = 1000
      RangeDomainDescription rangeDomainDescriptionMinMax = new RangeDomainDescription("RangeDomain_0_1000",
        FieldType.Integer, 0, 1000)
      { Description = "Domain value ranges from 0 to 1000" };
    
      SchemaBuilder schemaBuilder = new SchemaBuilder(geodatabase);
    
      // Create  a range domain 
      schemaBuilder.Create(rangeDomainDescriptionMinMax);
      schemaBuilder.Build();
    }
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also