ArcGIS Pro 3.4 API Reference Guide
ArcGIS.Core.Data Namespace / TableDefinition Class / HasGlobalID Method
Example

In This Topic
    HasGlobalID Method
    In This Topic
    Gets a value indicating whether this table has a field containing GlobalIDs. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax
    public bool HasGlobalID()
    Public Function HasGlobalID() As Boolean

    Return Value

    true if this table has a field containing GlobalIDs; otherwise, false.
    Exceptions
    ExceptionDescription
    The definition does not support this operation (e.g., the table is a shapefile).
    A geodatabase-related exception has occurred.
    Remarks
    A global ID is required to uniquely identify a row between tables. Workflows such as replication require that global IDs are present.
    Example
    Obtaining List of Definitions 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"))))
            {
                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>();
            }
        });
    }
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also