Exemple #1
0
 /// <summary>
 /// Determines if a hostname is available
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.WebSites.IWebSiteOperations.
 /// </param>
 /// <param name='webSiteName'>
 /// The name of the web site.
 /// </param>
 /// <returns>
 /// The Is Hostname Available operation response.
 /// </returns>
 public static WebSiteIsHostnameAvailableResponse IsHostnameAvailable(this IWebSiteOperations operations, string webSiteName)
 {
     try
     {
         return(operations.IsHostnameAvailableAsync(webSiteName).Result);
     }
     catch (AggregateException ex)
     {
         if (ex.InnerExceptions.Count > 1)
         {
             throw;
         }
         else
         {
             throw ex.InnerException;
         }
     }
 }
Exemple #2
0
 /// <summary>
 /// Determines if a hostname is available
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.WebSites.IWebSiteOperations.
 /// </param>
 /// <param name='webSiteName'>
 /// The name of the web site.
 /// </param>
 /// <returns>
 /// The Is Hostname Available operation response.
 /// </returns>
 public static Task <WebSiteIsHostnameAvailableResponse> IsHostnameAvailableAsync(this IWebSiteOperations operations, string webSiteName)
 {
     return(operations.IsHostnameAvailableAsync(webSiteName, CancellationToken.None));
 }