Return Value
The name of the definition.
Exception | Description |
---|---|
ArcGIS.Core.Data.Exceptions.GeodatabaseException | A geodatabase-related exception has occurred. |
public async Task ObtainingDefinitionsFromGeodatabase() { await ArcGIS.Desktop.Framework.Threading.Tasks.QueuedTask.Run(() => { using (Geodatabase geodatabase = new Geodatabase( new DatabaseConnectionFile(new Uri("path\\to\\sde\\file\\sdefile.sde")))) { var enterpriseDefinitions = geodatabase.GetDefinitions<FeatureClassDefinition>(); IEnumerable<Definition> featureClassesHavingGlobalID = enterpriseDefinitions.Where(definition => definition.HasGlobalID()); var featureDatasetDefinitions = geodatabase.GetDefinitions<FeatureDatasetDefinition>(); bool electionRelatedFeatureDatasets = featureDatasetDefinitions.Any( definition => definition.GetName().Contains("Election")); var attributedRelationshipClassDefinitions = geodatabase.GetDefinitions<AttributedRelationshipClassDefinition>(); var relationshipClassDefinitions = geodatabase.GetDefinitions<RelationshipClassDefinition>(); } }); }
Target Platforms: Windows 11, Windows 10, Windows 8.1