Class SqlDatabaseCollection | Azure SDK for .NET
James Stevens
Published Feb 16, 2026
A class representing collection of SqlDatabase and their operations over its parent.
Inheritance
Azure.ResourceManager.Core.ArmCollection
SqlDatabaseCollection
Namespace: System.Dynamic.ExpandoObject
Assembly: Azure.ResourceManager.Sql.dll
Syntax
public class SqlDatabaseCollection : Azure.ResourceManager.Core.ArmCollection, System.Collections.Generic.IAsyncEnumerable<Azure.ResourceManager.Sql.SqlDatabase>, System.Collections.Generic.IEnumerable<Azure.ResourceManager.Sql.SqlDatabase> Constructors
SqlDatabaseCollection()
Declaration
protected SqlDatabaseCollection (); Properties
ValidResourceType
Gets the valid resource type for this object.
Declaration
protected override Azure.ResourceManager.ResourceType ValidResourceType { get; } Property Value
| Azure.ResourceManager.ResourceType |
Methods
CheckIfExists(String, CancellationToken)
Tries to get details for this resource from the service.
Declaration
public virtual Azure.Response<bool> CheckIfExists (string databaseName, System.Threading.CancellationToken cancellationToken = null); Parameters
| System.String databaseName The name of the database. |
| System.Threading.CancellationToken cancellationToken The cancellation token to use. |
Returns
| Azure.Response<System.Boolean> |
Exceptions
| System.ArgumentNullException
|
CheckIfExistsAsync(String, CancellationToken)
Tries to get details for this resource from the service.
Declaration
[System.Diagnostics.DebuggerStepThrough]
public virtual System.Threading.Tasks.Task<Azure.Response<bool>> CheckIfExistsAsync (string databaseName, System.Threading.CancellationToken cancellationToken = null); Parameters
| System.String databaseName The name of the database. |
| System.Threading.CancellationToken cancellationToken The cancellation token to use. |
Returns
| System.Threading.Tasks.Task<Azure.Response<System.Boolean>> |
Exceptions
| System.ArgumentNullException
|
CreateOrUpdate(String, SqlDatabaseData, Boolean, CancellationToken)
Creates a new database or updates an existing database.
Declaration
public virtual Azure.ResourceManager.Sql.Models.DatabaseCreateOrUpdateOperation CreateOrUpdate (string databaseName, Azure.ResourceManager.Sql.SqlDatabaseData parameters, bool waitForCompletion = true, System.Threading.CancellationToken cancellationToken = null); Parameters
| System.String databaseName The name of the database. |
| SqlDatabaseData parameters The requested database resource state. |
| System.Boolean waitForCompletion Waits for the completion of the long running operations. |
| System.Threading.CancellationToken cancellationToken The cancellation token to use. |
Returns
Exceptions
| System.ArgumentNullException
|
CreateOrUpdateAsync(String, SqlDatabaseData, Boolean, CancellationToken)
Creates a new database or updates an existing database.
Declaration
[System.Diagnostics.DebuggerStepThrough]
public virtual System.Threading.Tasks.Task<Azure.ResourceManager.Sql.Models.DatabaseCreateOrUpdateOperation> CreateOrUpdateAsync (string databaseName, Azure.ResourceManager.Sql.SqlDatabaseData parameters, bool waitForCompletion = true, System.Threading.CancellationToken cancellationToken = null); Parameters
| System.String databaseName The name of the database. |
| SqlDatabaseData parameters The requested database resource state. |
| System.Boolean waitForCompletion Waits for the completion of the long running operations. |
| System.Threading.CancellationToken cancellationToken The cancellation token to use. |
Returns
Exceptions
| System.ArgumentNullException
|
Get(String, CancellationToken)
Gets a database.
Declaration
public virtual Azure.Response<Azure.ResourceManager.Sql.SqlDatabase> Get (string databaseName, System.Threading.CancellationToken cancellationToken = null); Parameters
| System.String databaseName The name of the database. |
| System.Threading.CancellationToken cancellationToken The cancellation token to use. |
Returns
Exceptions
| System.ArgumentNullException
|
GetAll(String, CancellationToken)
Gets a list of databases.
Declaration
public virtual Azure.Pageable<Azure.ResourceManager.Sql.SqlDatabase> GetAll (string skipToken = null, System.Threading.CancellationToken cancellationToken = null); Parameters
| System.String skipToken The String to use. |
| System.Threading.CancellationToken cancellationToken The cancellation token to use. |
Returns
| Azure.Pageable<SqlDatabase> A collection of SqlDatabase that may take multiple service requests to iterate over. |
GetAllAsync(String, CancellationToken)
Gets a list of databases.
Declaration
public virtual Azure.AsyncPageable<Azure.ResourceManager.Sql.SqlDatabase> GetAllAsync (string skipToken = null, System.Threading.CancellationToken cancellationToken = null); Parameters
| System.String skipToken The String to use. |
| System.Threading.CancellationToken cancellationToken The cancellation token to use. |
Returns
| Azure.AsyncPageable<SqlDatabase> An async collection of SqlDatabase that may take multiple service requests to iterate over. |
GetAsync(String, CancellationToken)
Gets a database.
Declaration
[System.Diagnostics.DebuggerStepThrough]
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.ResourceManager.Sql.SqlDatabase>> GetAsync (string databaseName, System.Threading.CancellationToken cancellationToken = null); Parameters
| System.String databaseName The name of the database. |
| System.Threading.CancellationToken cancellationToken The cancellation token to use. |
Returns
| System.Threading.Tasks.Task<Azure.Response<SqlDatabase>> |
Exceptions
| System.ArgumentNullException
|
GetIfExists(String, CancellationToken)
Tries to get details for this resource from the service.
Declaration
public virtual Azure.Response<Azure.ResourceManager.Sql.SqlDatabase> GetIfExists (string databaseName, System.Threading.CancellationToken cancellationToken = null); Parameters
| System.String databaseName The name of the database. |
| System.Threading.CancellationToken cancellationToken The cancellation token to use. |
Returns
Exceptions
| System.ArgumentNullException
|
GetIfExistsAsync(String, CancellationToken)
Tries to get details for this resource from the service.
Declaration
[System.Diagnostics.DebuggerStepThrough]
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.ResourceManager.Sql.SqlDatabase>> GetIfExistsAsync (string databaseName, System.Threading.CancellationToken cancellationToken = null); Parameters
| System.String databaseName The name of the database. |
| System.Threading.CancellationToken cancellationToken The cancellation token to use. |
Returns
| System.Threading.Tasks.Task<Azure.Response<SqlDatabase>> |
Exceptions
| System.ArgumentNullException
|
Explicit Interface Implementations
IAsyncEnumerable<SqlDatabase>.GetAsyncEnumerator(CancellationToken)
Returns an enumerator that iterates asynchronously through the collection.
Declaration
System.Collections.Generic.IAsyncEnumerator<Azure.ResourceManager.Sql.SqlDatabase> IAsyncEnumerable<SqlDatabase>.GetAsyncEnumerator (System.Threading.CancellationToken cancellationToken); Parameters
| System.Threading.CancellationToken cancellationToken A System.Threading.CancellationToken that may be used to cancel the asynchronous iteration. |
Returns
| System.Collections.Generic.IAsyncEnumerator<SqlDatabase> An enumerator that can be used to iterate asynchronously through the collection. |
IEnumerable<SqlDatabase>.GetEnumerator()
Returns an enumerator that iterates through the collection.
Declaration
System.Collections.Generic.IEnumerator<Azure.ResourceManager.Sql.SqlDatabase> IEnumerable<SqlDatabase>.GetEnumerator (); Returns
| System.Collections.Generic.IEnumerator<SqlDatabase> An enumerator that can be used to iterate through the collection. |
IEnumerable.GetEnumerator()
Returns an enumerator that iterates through a collection.
Declaration
System.Collections.IEnumerator IEnumerable.GetEnumerator (); Returns
| System.Collections.IEnumerator An System.Collections.IEnumerator object that can be used to iterate through the collection. |