ArcGIS Pro 2.9 API Reference Guide
AddFeatureClass(FeatureDatasetDescription,FeatureClassDescription) Method
Example 

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.
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
ExceptionDescription
The ArcGIS.Core.Geometry.SpatialReference of the featureDatasetDescription and the featureClassDescription do not match.
featureDatasetDescription and/or featureClassDescription is null.
Memory ArcGIS.Core.Data.Geodatabase does not support feature datasets.
Remarks
Adds a ArcGIS.Core.Data.FeatureClass to the ArcGIS.Core.Data.FeatureDataset
Example
// 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

See Also

Reference

SchemaBuilder Class
SchemaBuilder Members
Overload List