コード例 #1
0
 /// <summary>
 /// Creates a new service namespace. Once created, this namespace's
 /// resource manifest is immutable. This operation is idempotent.
 /// (see http://msdn.microsoft.com/en-us/library/windowsazure/jj856303.aspx
 /// for more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.ServiceBus.INamespaceOperations.
 /// </param>
 /// <param name='namespaceName'>
 /// The namespace name.
 /// </param>
 /// <param name='region'>
 /// The namespace region.
 /// </param>
 /// <returns>
 /// The response to a request for a particular namespace.
 /// </returns>
 public static ServiceBusNamespaceResponse Create(this INamespaceOperations operations, string namespaceName, string region)
 {
     try
     {
         return(operations.CreateAsync(namespaceName, region).Result);
     }
     catch (AggregateException ex)
     {
         if (ex.InnerExceptions.Count > 1)
         {
             throw;
         }
         else
         {
             throw ex.InnerException;
         }
     }
 }
コード例 #2
0
 /// <summary>
 /// Creates a new service namespace. Once created, this namespace's
 /// resource manifest is immutable. This operation is idempotent.
 /// (see http://msdn.microsoft.com/en-us/library/windowsazure/jj856303.aspx
 /// for more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.ServiceBus.INamespaceOperations.
 /// </param>
 /// <param name='namespaceName'>
 /// The namespace name.
 /// </param>
 /// <param name='region'>
 /// The namespace region.
 /// </param>
 /// <returns>
 /// The response to a request for a particular namespace.
 /// </returns>
 public static Task <ServiceBusNamespaceResponse> CreateAsync(this INamespaceOperations operations, string namespaceName, string region)
 {
     return(operations.CreateAsync(namespaceName, region, CancellationToken.None));
 }