ArcGIS Pro 3.4 API Reference Guide
ArcGIS.Desktop.Editing.Attributes Namespace / Inspector Class / ApplyAsync Method
Example

In This Topic
    ApplyAsync Method (Inspector)
    In This Topic
    Apply the attribute changes. Writing them back to the database in an Edit Operation.
    Syntax
    public Task<bool> ApplyAsync()
    Public Function ApplyAsync() As Task(Of Boolean)

    Return Value

    A Task returning a Boolean indicating whether the value was applied to the database.
    Example
    Load map selection into Inspector and Change Attributes
    // get the currently selected features in the map
    var selectedFeatures = ArcGIS.Desktop.Mapping.MapView.Active.Map.GetSelection();
    // get the first layer and its corresponding selected feature OIDs
    var firstSelectionSet = selectedFeatures.ToDictionary().First();
    
    // create an instance of the inspector class
    var inspector = new ArcGIS.Desktop.Editing.Attributes.Inspector();
    // load the selected features into the inspector using a list of object IDs
    await inspector.LoadAsync(firstSelectionSet.Key, firstSelectionSet.Value);
    
    // assign the new attribute value to the field "Description"
    // if more than one features are loaded, the change applies to all features
    inspector["Description"] = "The new value.";
    // apply the changes as an edit operation 
    await inspector.ApplyAsync();
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also