/// <summary> /// The Update Bgp Peering operation updates an existing bgp peering or /// creates a new one if one doesn't exist. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.Management.ExpressRoute.IBgpPeeringOperations. /// </param> /// <param name='serviceKey'> /// The service key representing the relationship between Azure and the /// customer. /// </param> /// <param name='accessType'> /// Whether the peering is private or public. /// </param> /// <param name='parameters'> /// Parameters supplied to the Update Bgp Peering operation. /// </param> /// <returns> /// The Get Bgp Peering Operation Response. /// </returns> public static BgpPeeringGetResponse Update(this IBgpPeeringOperations operations, string serviceKey, BgpPeeringAccessType accessType, BgpPeeringUpdateParameters parameters) { try { return operations.UpdateAsync(serviceKey, accessType, parameters).Result; } catch (AggregateException ex) { if (ex.InnerExceptions.Count > 1) { throw; } else { throw ex.InnerException; } } }
/// <summary> /// The Update Bgp Peering operation updates an existing bgp peering or /// creates a new one if one doesn't exist. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.Management.ExpressRoute.IBgpPeeringOperations. /// </param> /// <param name='serviceKey'> /// The service key representing the relationship between Azure and the /// customer. /// </param> /// <param name='accessType'> /// Whether the peering is private or public. /// </param> /// <param name='parameters'> /// Parameters supplied to the Update Bgp Peering operation. /// </param> /// <returns> /// The Get Bgp Peering Operation Response. /// </returns> public static Task<BgpPeeringGetResponse> UpdateAsync(this IBgpPeeringOperations operations, string serviceKey, BgpPeeringAccessType accessType, BgpPeeringUpdateParameters parameters) { return operations.UpdateAsync(serviceKey, accessType, parameters, CancellationToken.None); }
/// <summary> /// The Update Bgp Peering operation updates an existing bgp peering or /// creates a new one if one doesn't exist. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.Management.ExpressRoute.IBgpPeeringOperations. /// </param> /// <param name='serviceKey'> /// Required. The service key representing the relationship between /// Azure and the customer. /// </param> /// <param name='accessType'> /// Required. Whether the peering is private or public. /// </param> /// <param name='parameters'> /// Required. Parameters supplied to the Update Bgp Peering operation. /// </param> /// <returns> /// The Get Bgp Peering Operation Response. /// </returns> public static BgpPeeringGetResponse Update(this IBgpPeeringOperations operations, string serviceKey, BgpPeeringAccessType accessType, BgpPeeringUpdateParameters parameters) { return Task.Factory.StartNew((object s) => { return ((IBgpPeeringOperations)s).UpdateAsync(serviceKey, accessType, parameters); } , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); }