ArcGIS Pro 3.2 API Reference Guide
ArcGIS.Core.Data.DDL Namespace / SchemaBuilder Class / AddFeatureClass Method / AddFeatureClass(FeatureDatasetDescription,FeatureClassDescription) Method
Indicates the ArcGIS.Core.Data.FeatureDataset where the ArcGIS.Core.Data.FeatureClass will be added.
Indicates the ArcGIS.Core.Data.FeatureClass to add.
Example

In This Topic
    AddFeatureClass(FeatureDatasetDescription,FeatureClassDescription) Method
    In This Topic
    Enqueue the Add operation on the object referred to by the FeatureDatasetDescription and the FeatureClassDescription.
    Syntax

    Parameters

    featureDatasetDescription
    Indicates the ArcGIS.Core.Data.FeatureDataset where the ArcGIS.Core.Data.FeatureClass will be added.
    featureClassDescription
    Indicates the ArcGIS.Core.Data.FeatureClass to add.
    Exceptions
    Remarks
    Example
    Adding a FeatureClass to a FeatureDataset
    public void AddFeatureClassToFeatureDatasetSnippet(Geodatabase geodatabase)
    {
      // Adding a FeatureClass with name 'Tax_Jurisdiction' into a FeatureDataset named as 'Parcels_Information'
    
      string featureDatasetName = "Parcels_Information";
      string featureClassNameToAdd = "Tax_Jurisdiction";
    
      FeatureDatasetDefinition featureDatasetDefinition = geodatabase.GetDefinition<FeatureDatasetDefinition>(featureDatasetName);
      FeatureDatasetDescription featureDatasetDescription = new FeatureDatasetDescription(featureDatasetDefinition);
    
      FeatureClassDefinition featureClassDefinition = geodatabase.GetDefinition<FeatureClassDefinition>(featureClassNameToAdd);
      FeatureClassDescription featureClassDescription = new FeatureClassDescription(featureClassDefinition);
    
      SchemaBuilder schemaBuilder = new SchemaBuilder(geodatabase);
    
      // Add the 'Tax_Jurisdiction' FeatureClass to the 'Parcels_Information' FeatureDataset 
      schemaBuilder.AddFeatureClass(featureDatasetDescription, featureClassDescription);
      bool addStatus = schemaBuilder.Build();
    
      if (!addStatus)
      {
        IReadOnlyList<string> errors = schemaBuilder.ErrorMessages;
      }
    }
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also