public class TableDefinition : Definition, System.IDisposable
Public Class TableDefinition Inherits Definition Implements System.IDisposable
public class TableDefinition : Definition, System.IDisposable
Public Class TableDefinition Inherits Definition Implements System.IDisposable
public async Task ObtainingDefinitionFromGeodatabase() { await ArcGIS.Desktop.Framework.Threading.Tasks.QueuedTask.Run(() => { using (Geodatabase geodatabase = new Geodatabase(new DatabaseConnectionFile(new Uri("path\\to\\sde\\file\\sdefile.sde")))) { // Remember that for Enterprise databases you have to qualify your dataset names with the DatabaseName and UserName. TableDefinition enterpriseTableDefinition = geodatabase.GetDefinition<TableDefinition>("LocalGovernment.GDB.CitizenContactInfo"); // It does not matter if the dataset is within a FeatureDataset or not. FeatureClassDefinition featureClassDefinition = geodatabase.GetDefinition<FeatureClassDefinition>("LocalGovernment.GDB.FireStation"); // GetDefinition For a RelationshipClass. RelationshipClassDefinition relationshipClassDefinition = geodatabase.GetDefinition<RelationshipClassDefinition>("LocalGovernment.GDB.AddressPointHasSiteAddresses"); // GetDefinition For a FeatureDataset. FeatureDatasetDefinition featureDatasetDefinition = geodatabase.GetDefinition<FeatureDatasetDefinition>("LocalGovernment.GDB.Address"); } }); }
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")))) { IReadOnlyList<FeatureClassDefinition> enterpriseDefinitions = geodatabase.GetDefinitions<FeatureClassDefinition>(); IEnumerable<Definition> featureClassesHavingGlobalID = enterpriseDefinitions.Where(definition => definition.HasGlobalID()); IReadOnlyList<FeatureDatasetDefinition> featureDatasetDefinitions = geodatabase.GetDefinitions<FeatureDatasetDefinition>(); bool electionRelatedFeatureDatasets = featureDatasetDefinitions.Any(definition => definition.GetName().Contains("Election")); IReadOnlyList<AttributedRelationshipClassDefinition> attributedRelationshipClassDefinitions = geodatabase.GetDefinitions<AttributedRelationshipClassDefinition>(); IReadOnlyList<RelationshipClassDefinition> relationshipClassDefinitions = geodatabase.GetDefinitions<RelationshipClassDefinition>(); } }); }
System.Object
ArcGIS.Core.CoreObjectsBase
ArcGIS.Core.Data.Definition
ArcGIS.Core.Data.TableDefinition
ArcGIS.Core.Data.FeatureClassDefinition
ArcGIS.Core.Data.Realtime.RealtimeTableDefinition
Target Platforms: Windows 11, Windows 10