/// <summary> /// Create a connection. (see /// http://aka.ms/azureautomationsdk/connectionoperations for more /// information) /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.Management.Automation.IConnectionOperations. /// </param> /// <param name='automationAccount'> /// Required. The automation account name. /// </param> /// <param name='parameters'> /// Required. The parameters supplied to the create connection /// operation. /// </param> /// <returns> /// The response model for the create connection operation. /// </returns> public static Task <ConnectionCreateResponse> CreateAsync(this IConnectionOperations operations, string automationAccount, ConnectionCreateParameters parameters) { return(operations.CreateAsync(automationAccount, parameters, CancellationToken.None)); }
/// <summary> /// Create a connection. (see /// http://aka.ms/azureautomationsdk/connectionoperations for more /// information) /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.Management.Automation.IConnectionOperations. /// </param> /// <param name='automationAccount'> /// Required. The automation account name. /// </param> /// <param name='parameters'> /// Required. The parameters supplied to the create connection /// operation. /// </param> /// <returns> /// The response model for the create connection operation. /// </returns> public static ConnectionCreateResponse Create(this IConnectionOperations operations, string automationAccount, ConnectionCreateParameters parameters) { return(Task.Factory.StartNew((object s) => { return ((IConnectionOperations)s).CreateAsync(automationAccount, parameters); } , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }