/// <summary> /// The New Dedicated Circuit operation creates a new dedicated circuit. /// </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 New Bgp Peering operation. /// </param> /// <returns> /// A standard express route gateway response including an HTTP status /// code and request ID. /// </returns> public static ExpressRouteOperationResponse BeginNew(this IBgpPeeringOperations operations, string serviceKey, BgpPeeringAccessType accessType, BgpPeeringNewParameters parameters) { return Task.Factory.StartNew((object s) => { return ((IBgpPeeringOperations)s).BeginNewAsync(serviceKey, accessType, parameters); } , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); }
/// <summary> /// The New Dedicated Circuit operation creates a new dedicated circuit. /// </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 New Bgp Peering operation. /// </param> /// <returns> /// A standard express route gateway response including an HTTP status /// code and request ID. /// </returns> public static ExpressRouteOperationResponse BeginNew(this IBgpPeeringOperations operations, string serviceKey, BgpPeeringAccessType accessType, BgpPeeringNewParameters parameters) { try { return operations.BeginNewAsync(serviceKey, accessType, parameters).Result; } catch (AggregateException ex) { if (ex.InnerExceptions.Count > 1) { throw; } else { throw ex.InnerException; } } }
/// <summary> /// The New Bgp Peering operation creates a new bgp peering associated /// with the dedicated circuit specified by the service key provided. /// </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 New Bgp Peering operation. /// </param> /// <returns> /// The Get Bgp Peering Operation Response. /// </returns> public static Task<BgpPeeringGetResponse> NewAsync(this IBgpPeeringOperations operations, string serviceKey, BgpPeeringAccessType accessType, BgpPeeringNewParameters parameters) { return operations.NewAsync(serviceKey, accessType, parameters, CancellationToken.None); }