ArcGIS Pro 3.0 API Reference Guide
ArcGIS.Core.Data Namespace / Definition Class / GetName Method
Example

In This Topic
    GetName Method (Definition)
    In This Topic
    Gets the name of the definition. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax
    public string GetName()
    Public Function GetName() As String

    Return Value

    The name of the definition.
    Exceptions
    ExceptionDescription
    A geodatabase-related exception has occurred.
    Example
    Obtaining List of Defintions from Geodatabase
    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>();
        }
      });
    }
    Requirements

    Target Platforms: Windows 11, Windows 10, Windows 8.1

    See Also