ArcGIS Pro 2.7 API Reference Guide
ImportMetadata(String,MDImportExportOption) Method
Example 

ArcGIS.Desktop.Core Namespace > Item Class > ImportMetadata Method : ImportMetadata(String,MDImportExportOption) Method
Import metadata. This method must be called on the MCT. Use QueuedTask.Run.
Syntax
public void ImportMetadata( 
   string catalogPathOrMDUri,
   MDImportExportOption importType
)
Public Overloads Sub ImportMetadata( _
   ByVal catalogPathOrMDUri As String, _
   ByVal importType As MDImportExportOption _
) 

Parameters

catalogPathOrMDUri
importType
Exceptions
ExceptionDescription
This method or property must be called within the lambda passed to QueuedTask.Run.
Example
// the input path can be the path to an item with metadata, or a URI to an XML file
IMetadata metadataItemImport1 = null;
await QueuedTask.Run(() => metadataItemImport1.ImportMetadata(@"E:\YellowStone.gdb\MyDataset\MyFeatureClass", MDImportExportOption.esriCurrentMetadataStyle));
Requirements

Target Platforms: Windows 10, Windows 8.1

See Also

Reference

Item Class
Item Members
Overload List