Show / Hide Table of Contents

Method ValidateRelationshipConstraintsAsync

ValidateRelationshipConstraintsAsync(ArcGISFeature)

Asynchronously validates constraints for a given feature participating in a relationship.

Declaration
public Task<RelationshipConstraintViolationType> ValidateRelationshipConstraintsAsync(ArcGISFeature feature)
Parameters
Type Name Description
ArcGISFeature feature

The feature.

Returns
Type Description
System.Threading.Tasks.Task<RelationshipConstraintViolationType>

A task that represents the asynchronous validation of relationship constraints operation. The value of the task result contains a RelationshipConstraintViolationType object.

Remarks

The following are considered violations:

In a composite relationship, adding an orphan feature to the destination table without relating it to an origin feature.

Cardinality Violations:

  • In 1:1 relationships, if an origin feature is already related to a destination feature, relating another feature to either of them.
  • In 1:n relationships, relating a destination feature to more than one origin feature.

To recover from an orphaned destination feature violation, simply relate it to a valid origin feature. You can usually recover from a cardinality violation by unrelating the appropriate features. Also, see UnrelateFeature(ArcGISFeature).

Edit operations do not error when there are constraint violations. This allows you to recover from violations in a back office operation after applying edits or syncing, if you choose to do so. See ArcGIS Desktop Validate Features process here.

Note: This method makes network calls to query for the related features if they are not present locally. If you have just related the feature you are validating, you need to first call UpdateFeatureAsync(Feature) to reflect the modified attribute value in the table. If this is not done, validation results may be incorrect.

Applies to

Platforms and versions
TargetVersions
.NET Standard 2.0100.3 - 200.7
.NET100.13 - 200.7
.NET Windows100.13 - 200.7
.NET Android200.0 - 200.7
.NET iOS200.0 - 200.7
.NET Framework100.1 - 200.7
Xamarin.Android100.1 - 100.15
Xamarin.iOS100.1 - 100.15
UWP100.1 - 200.7
In This Article
Back to top Copyright © 2022 Esri.