/// <summary> /// Returns the list database operations for a given server and /// database. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.Management.Sql.IDatabaseOperationOperations. /// </param> /// <param name='serverName'> /// The name of the SQL Server to be queried. /// </param> /// <param name='databaseName'> /// The name of the Database to be queried. /// </param> /// <returns> /// Response containing the list of database operations for a given /// server or database. /// </returns> public static DatabaseOperationListResponse ListByDatabase(this IDatabaseOperationOperations operations, string serverName, string databaseName) { try { return(operations.ListByDatabaseAsync(serverName, databaseName).Result); } catch (AggregateException ex) { if (ex.InnerExceptions.Count > 1) { throw; } else { throw ex.InnerException; } } }
/// <summary> /// Returns the list database operations for a given server and /// database. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.Management.Sql.IDatabaseOperationOperations. /// </param> /// <param name='serverName'> /// Required. The name of the SQL Server to be queried. /// </param> /// <param name='databaseName'> /// Required. The name of the Database to be queried. /// </param> /// <returns> /// Response containing the list of database operations for a given /// server or database. /// </returns> public static Task <DatabaseOperationListResponse> ListByDatabaseAsync(this IDatabaseOperationOperations operations, string serverName, string databaseName) { return(operations.ListByDatabaseAsync(serverName, databaseName, CancellationToken.None)); }