I'd like to know if there is a simple function that will tell me if a dataset with a specific name exists or not.
Under ArcObjects we used to do this:
pWsSource2 = CType(pOutworkspace, IWorkspace2)
If pWsSource2.NameExists(esriDatasetType.esriDTFeatureClass, "whatever_the_name") Then
...
...
But with ArcGIS Pro SDK, I can only see a solution that does involve a loop like this:
var datasetDefinitions = geodatabaseMTNC.GetDefinitions<ArcGIS.Core.Data.FeatureDatasetDefinition>();
// Loop through the results
foreach (var definition in datasetDefinitions)
{
if(definition.GetName() == "whatever_the_name")
{
// Do something
}
}
Is there another approach?