ArcGIS Pro 3.8 API Reference Guide
ArcGIS.Desktop.Editing Namespace / EditOperation Class / Modify Method / Modify(MapMember,Int64,Dictionary<String,Object>) Method
The mapMember of the row to update.
The oid of the row to update.
The attribute values to update on the row (by field name).
Example

In This Topic
    Modify(MapMember,Int64,Dictionary<String,Object>) Method
    In This Topic
    Modify a row, updating the attribute values.
    Syntax
    Public Overloads Sub Modify( _
       ByVal mapMember As MapMember, _
       ByVal oid As Long, _
       ByVal attributes As Dictionary(Of String,Object) _
    ) 

    Parameters

    mapMember
    The mapMember of the row to update.
    oid
    The oid of the row to update.
    attributes
    The attribute values to update on the row (by field name).
    Example
    Order edits sequentially
    // Modifies the "NAME" attribute of a specified feature and then splits the feature using the provided polyline, all within a single sequential edit operation.
    // perform an edit and then a split as one operation.
    await QueuedTask.Run(() =>
     {
       var newName = "Modified then Split";
       var queryFilter = new QueryFilter() { WhereClause = "OBJECTID = " + objectId.ToString() };
    
       // create an edit operation and name.
       var op = new EditOperation
       {
         Name = "modify followed by split",         // set the ExecuteMode
         ExecuteMode = ExecuteModeType.Sequential
       };
       using (var rowCursor = layer.Search(queryFilter))
       {
         while (rowCursor.MoveNext())
         {
           using var feature = rowCursor.Current as ArcGIS.Core.Data.Feature;
           op.Modify(feature, "NAME", newName);
         }
       }
       op.Split(layer, objectId, splitLine);
       if (!op.IsEmpty)
       {
         bool result = op.Execute();
       }
       // else
       //  The operation doesn't make any changes to the database so if executed it will fail
     });
    Read and Write blob fields with the attribute inspector
    await QueuedTask.Run(() =>
    {
      // get selected feature into inspector
      var selectedFeatures = activeMap.GetSelection();
      var insp = new Inspector();
      insp.Load(selectedFeatures.ToDictionary().Keys.First(), selectedFeatures.ToDictionary().Values.First());
      // read a blob field and save to a file
      var msw = new MemoryStream();
      msw = insp["BlobField"] as MemoryStream;
      using (FileStream file = new(@"d:\temp\blob.jpg", FileMode.Create, FileAccess.Write))
      {
        msw.WriteTo(file);
      }
      // read file into memory stream
      var msr = new MemoryStream();
      using (FileStream file = new(@"d:\images\Hydrant.jpg", FileMode.Open, FileAccess.Read))
      {
        file.CopyTo(msr);
      }
      //put the memory stream in the blob field and save to feature
      var op = new EditOperation() { Name = "Blob Inspector" };
      insp["Blobfield"] = msr;
      op.Modify(insp);
      if (!op.IsEmpty)
      {
        var result = op.Execute(); //Execute and ExecuteAsync will return true if the operation was successful and false if not
      }
    });
    Write a compressed image to a raster field
    var compressedRasterMapView = MapView.Active;
    if (compressedRasterMapView == null)
      return;
    
    await QueuedTask.Run(() =>
    {
      //Open the raster dataset on disk and create a compressed raster value dataset object
      var dataStore = new ArcGIS.Core.Data.FileSystemDatastore(new ArcGIS.Core.Data.FileSystemConnectionPath(new Uri(@"e:\temp"), ArcGIS.Core.Data.FileSystemDatastoreType.Raster));
      using (var fileRasterDataset = dataStore.OpenDataset<ArcGIS.Core.Data.Raster.RasterDataset>("Hydrant.jpg"))
      {
        var storageDef = new ArcGIS.Core.Data.Raster.RasterStorageDef();
        storageDef.SetCompressionType(ArcGIS.Core.Data.Raster.RasterCompressionType.JPEG);
        storageDef.SetCompressionQuality(90);
    
        var rv = new ArcGIS.Core.Data.Raster.RasterValue();
        rv.SetRasterDataset(fileRasterDataset);
        rv.SetRasterStorageDef(storageDef);
    
        var sel = compressedRasterMapView.Map.GetSelection();
    
        //insert a raster value object into the raster field
        var insp = new ArcGIS.Desktop.Editing.Attributes.Inspector();
        insp.Load(sel.ToDictionary().Keys.First(), sel.ToDictionary().Values.First());
        insp["Photo"] = rv;
    
        var op = new EditOperation() { Name = "Raster Inspector" };
        op.Modify(insp);
        if (!op.IsEmpty)
        {
          var result = op.Execute(); //Execute and ExecuteAsync will return true if the operation was successful and false if not
        }
      }
    });
    Requirements

    Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)

    ArcGIS Pro version: 3.0 or higher.
    See Also