ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Core Namespace / CoreObjectsBase Class / Dispose Method / Dispose() Method
Example

In This Topic
    Dispose() Method
    In This Topic
    Releases this object's unmanaged resources.
    Syntax
    Public Overloads Sub Dispose() 
    public void Dispose()
    Example
    Checking for the existence of a Table
    {
      //Must be called within QueuedTask.Run().
      bool TableExists(Geodatabase geodatabase, string tableName)
      {
        try
        {
          using TableDefinition tableDefinition =
            geodatabase.GetDefinition<TableDefinition>(tableName);
          return true;
        }
        catch
        {
          // GetDefinition throws an exception if the definition doesn't exist
          return false;
        }
      }
    }
    Checking for the existence of a Feature Class
    {
      //Must be called within QueuedTask.Run().
      bool FeatureClassExists(Geodatabase geodatabase, string featureClassName)
      {
        try
        {
          using FeatureClassDefinition featureClassDefinition =
            geodatabase.GetDefinition<FeatureClassDefinition>(featureClassName);
          return true;
        }
        catch
        {
          // GetDefinition throws an exception if the definition doesn't exist
          return false;
        }
      }
    }
    Requirements

    Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)

    ArcGIS Pro version: 3.0 or higher.
    See Also