/// <summary>
 /// Creates a new topic. Once created, this topic resource manifest is
 /// immutable. This operation is not idempotent. Repeating the create
 /// call, after a topic with same name has been created successfully,
 /// will result in a 409 Conflict error message.  (see
 /// http://msdn.microsoft.com/en-us/library/windowsazure/hh780728.aspx
 /// for more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.ServiceBus.ITopicOperations.
 /// </param>
 /// <param name='namespaceName'>
 /// Required. The namespace name.
 /// </param>
 /// <param name='topic'>
 /// Required. The Service Bus topic.
 /// </param>
 /// <returns>
 /// A response to a request for a particular topic.
 /// </returns>
 public static ServiceBusTopicResponse Create(this ITopicOperations operations, string namespaceName, ServiceBusTopic topic)
 {
     return Task.Factory.StartNew((object s) => 
     {
         return ((ITopicOperations)s).CreateAsync(namespaceName, topic);
     }
     , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
 }
 /// <summary>
 /// Creates a new topic. Once created, this topic resource manifest is
 /// immutable. This operation is not idempotent. Repeating the create
 /// call, after a topic with same name has been created successfully,
 /// will result in a 409 Conflict error message.  (see
 /// http://msdn.microsoft.com/en-us/library/windowsazure/hh780728.aspx
 /// for more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.ServiceBus.ITopicOperations.
 /// </param>
 /// <param name='namespaceName'>
 /// The namespace name.
 /// </param>
 /// <param name='topic'>
 /// The Service Bus topic.
 /// </param>
 /// <returns>
 /// A response to a request for a particular topic.
 /// </returns>
 public static ServiceBusTopicResponse Create(this ITopicOperations operations, string namespaceName, ServiceBusTopic topic)
 {
     try
     {
         return operations.CreateAsync(namespaceName, topic).Result;
     }
     catch (AggregateException ex)
     {
         if (ex.InnerExceptions.Count > 1)
         {
             throw;
         }
         else
         {
             throw ex.InnerException;
         }
     }
 }
 /// <summary>
 /// Creates a new topic. Once created, this topic resource manifest is
 /// immutable. This operation is not idempotent. Repeating the create
 /// call, after a topic with same name has been created successfully,
 /// will result in a 409 Conflict error message.  (see
 /// http://msdn.microsoft.com/en-us/library/windowsazure/hh780728.aspx
 /// for more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.ServiceBus.ITopicOperations.
 /// </param>
 /// <param name='namespaceName'>
 /// Required. The namespace name.
 /// </param>
 /// <param name='topic'>
 /// Required. The Service Bus topic.
 /// </param>
 /// <returns>
 /// A response to a request for a particular topic.
 /// </returns>
 public static Task<ServiceBusTopicResponse> CreateAsync(this ITopicOperations operations, string namespaceName, ServiceBusTopic topic)
 {
     return operations.CreateAsync(namespaceName, topic, CancellationToken.None);
 }