ArcGIS Pro 3.4 API Reference Guide
ArcGIS.Core.Data Namespace / ContingencyValidationResult Class / Matches Property
Example

In This Topic
    Matches Property
    In This Topic
    Gets the list of matched contingency constraints.
    Syntax
    public IReadOnlyList<Contingency> Matches {get;}
    Public ReadOnly Property Matches As IReadOnlyList(Of Contingency)
    Remarks
    Provides a list of valid contingencies.
    Example
    Validate contingent attribute values
    public void ValidateContingentValues(FeatureClass parcels, string zoningFieldName = "Zone", string taxCodeFieldName = "TaxCode")
    {
        using (RowBuffer rowBuffer = parcels.CreateRowBuffer())
        {
            // Insert values in a row buffer
            rowBuffer[zoningFieldName] = "Business";
            rowBuffer[taxCodeFieldName] = "TaxB";
    
            // Validate contingency values of the parcels' row 
            ContingencyValidationResult contingencyValidationResult = parcels.ValidateContingencies(rowBuffer);
    
            // Valid contingencies
            IReadOnlyList<Contingency> matchedContingencies = contingencyValidationResult.Matches;
            if (matchedContingencies.Count > 0)
            {
                // Create a row with valid contingency values
                parcels.CreateRow(rowBuffer);
            }
    
            // Invalid contingencies
            IReadOnlyList<ContingencyViolation> violatedContingencies = contingencyValidationResult.Violations;
            foreach (ContingencyViolation contingencyViolation in violatedContingencies)
            {
                ContingencyViolationType violationType = contingencyViolation.Type;
                Contingency violatedContingency = contingencyViolation.Contingency;
            }
        }
    }
    
    
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3.4 or higher.
    See Also