ArcGIS Pro 3.3 API Reference Guide
ArcGIS.Core.Data.DDL Namespace / SchemaBuilder Class / RemoveRelationshipClass Method / RemoveRelationshipClass(FeatureDatasetDescription,RelationshipClassDescription) Method
Indicates the ArcGIS.Core.Data.FeatureDataset where the ArcGIS.Core.Data.RelationshipClass will be removed.
Indicates the ArcGIS.Core.Data.RelationshipClass to remove.
Example

In This Topic
    RemoveRelationshipClass(FeatureDatasetDescription,RelationshipClassDescription) Method
    In This Topic
    Enqueue the Remove operation on the object referred to by the FeatureDatasetDescription and the RelationshipClassDescription.
    Syntax

    Parameters

    featureDatasetDescription
    Indicates the ArcGIS.Core.Data.FeatureDataset where the ArcGIS.Core.Data.RelationshipClass will be removed.
    relationshipClassDescription
    Indicates the ArcGIS.Core.Data.RelationshipClass to remove.
    Exceptions
    ExceptionDescription
    The relationship split policy and/or the relationship rules are invalid.
    featureDatasetDescription and/or relationshipClassDescription is null.
    Memory ArcGIS.Core.Data.Geodatabase does not support relationship classes.
    The relationship split policy is not supported.
    Example
    Adding/Removing Relationship class in/out of a feature dataset
    public void MoveRelationshipClass(SchemaBuilder schemaBuilder, FeatureDatasetDefinition featureDatasetDefinition, RelationshipClassDefinition relationshipClassDefinition)
    {
      FeatureDatasetDescription featureDatasetDescription = new FeatureDatasetDescription(featureDatasetDefinition);
      RelationshipClassDescription relationshipClassDescription = new RelationshipClassDescription(relationshipClassDefinition);
    
      // Remove relationship class from the feature dataset
      schemaBuilder.RemoveRelationshipClass(featureDatasetDescription, relationshipClassDescription);
    
      // Add relationship class inside the feature dataset
      // schemaBuilder.AddRelationshipClass(featureDatasetDescription, relationshipClassDescription);
    
      schemaBuilder.Build();
    }
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3.1 or higher.
    See Also