/// <summary>
 /// Gets the set of connection strings for a relay.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.ServiceBus.IRelayOperations.
 /// </param>
 /// <param name='namespaceName'>
 /// The namespace name.
 /// </param>
 /// <param name='relayName'>
 /// The relay name.
 /// </param>
 /// <returns>
 /// The set of connection details for a service bus entity.
 /// </returns>
 public static ServiceBusConnectionDetailsResponse GetConnectionDetails(this IRelayOperations operations, string namespaceName, string relayName)
 {
     try
     {
         return(operations.GetConnectionDetailsAsync(namespaceName, relayName).Result);
     }
     catch (AggregateException ex)
     {
         if (ex.InnerExceptions.Count > 1)
         {
             throw;
         }
         else
         {
             throw ex.InnerException;
         }
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Gets the set of connection strings for a relay.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.ServiceBus.IRelayOperations.
 /// </param>
 /// <param name='namespaceName'>
 /// Required. The namespace name.
 /// </param>
 /// <param name='relayName'>
 /// Required. The relay name.
 /// </param>
 /// <returns>
 /// The set of connection details for a service bus entity.
 /// </returns>
 public static Task <ServiceBusConnectionDetailsResponse> GetConnectionDetailsAsync(this IRelayOperations operations, string namespaceName, string relayName)
 {
     return(operations.GetConnectionDetailsAsync(namespaceName, relayName, CancellationToken.None));
 }