ArcGIS Pro 3.0 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

AddFeatureClass(FeatureDatasetDescription,FeatureClassDescription) Method
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
// 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, Windows 8.1

ArcGIS Pro version: 2.9 or higher.
See Also