/// <summary>
 /// Returns information about all Service Objectives on a database
 /// server.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Sql.IServiceObjectiveOperations.
 /// </param>
 /// <param name='serverName'>
 /// The name of the database server to be queried.
 /// </param>
 /// <returns>
 /// Response containing the list of service objective for a given
 /// server.
 /// </returns>
 public static ServiceObjectiveListResponse List(this IServiceObjectiveOperations operations, string serverName)
 {
     try
     {
         return(operations.ListAsync(serverName).Result);
     }
     catch (AggregateException ex)
     {
         if (ex.InnerExceptions.Count > 1)
         {
             throw;
         }
         else
         {
             throw ex.InnerException;
         }
     }
 }
Example #2
0
 /// <summary>
 /// Returns information about an Azure SQL Database Server Service
 /// Objectives.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.Sql.LegacySdk.IServiceObjectiveOperations.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Required. The name of the Resource Group to which the server
 /// belongs.
 /// </param>
 /// <param name='serverName'>
 /// Required. The name of the Server.
 /// </param>
 /// <returns>
 /// Represents the response to a Get Azure Sql Database Service
 /// Objectives request.
 /// </returns>
 public static Task <ServiceObjectiveListResponse> ListAsync(this IServiceObjectiveOperations operations, string resourceGroupName, string serverName)
 {
     return(operations.ListAsync(resourceGroupName, serverName, CancellationToken.None));
 }