I need to create a new Geodatabase and creating FeatureClass, Table in the Geodatabase. After that adding fields in FeatureClass and Table are also needed.
I have created a new Geodatabase using this code:
private async Task<bool> ExecuteAddFileGDB(string fileGdbPath, string fileGdbName)
{
try
{
return await ArcGIS.Desktop.Framework.Threading.Tasks.QueuedTask.Run(() =>
{
var fGdbPath = fileGdbPath;
var fGdbName = fileGdbName;
var fGdbVersion = "Current";
var parameters = Geoprocessing.MakeValueArray
(fGdbPath, fGdbName, fGdbVersion);
var cts = new CancellationTokenSource();
var results = Geoprocessing.ExecuteToolAsync("management.CreateFileGDB", parameters, null, cts.Token,
(eventName, o) =>
{
System.Diagnostics.Debug.WriteLine($@"GP event: {eventName}");
});
return true;
});
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
return false;
}
}
I have also code developed for creating FeatureClass, Table, and for adding Fields using Geoprocessing Tools.
As my ArcObjects experience, I think a geoprocessing operation is comparatively costly than an API call. So I am seeking a way to create a new geodatabase using ArcGIS Pro API instead of the Geoprocessing tool.
Like ArcObject API http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#//0001000004t8000000.
As well as for creating FeatureClass, Table, and for adding Fields.