/// <summary> /// EntitleResource is used only for 3rd party Store providers. Each /// subscription must be entitled for the resource before creating /// that particular type of resource. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.Management.Scheduler.ICloudServiceManagementClient. /// </param> /// <param name='parameters'> /// Required. Parameters provided to the EntitleResource method. /// </param> /// <returns> /// A standard service response including an HTTP status code and /// request ID. /// </returns> public static OperationResponse EntitleResource(this ICloudServiceManagementClient operations, EntitleResourceParameters parameters) { return Task.Factory.StartNew((object s) => { return ((ICloudServiceManagementClient)s).EntitleResourceAsync(parameters); } , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); }
/// <summary> /// EntitleResource is used only for 3rd party Store providers. Each /// subscription must be entitled for the resource before creating /// that particular type of resource. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.Management.Scheduler.ICloudServiceManagementClient. /// </param> /// <param name='parameters'> /// Parameters provided to the EntitleResource method. /// </param> /// <returns> /// A standard service response including an HTTP status code and /// request ID. /// </returns> public static OperationResponse EntitleResource(this ICloudServiceManagementClient operations, EntitleResourceParameters parameters) { try { return operations.EntitleResourceAsync(parameters).Result; } catch (AggregateException ex) { if (ex.InnerExceptions.Count > 1) { throw; } else { throw ex.InnerException; } } }
/// <summary> /// EntitleResource is used only for 3rd party Store providers. Each /// subscription must be entitled for the resource before creating /// that particular type of resource. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.Management.Scheduler.ICloudServiceManagementClient. /// </param> /// <param name='parameters'> /// Parameters provided to the EntitleResource method. /// </param> /// <returns> /// A standard service response including an HTTP status code and /// request ID. /// </returns> public static Task<OperationResponse> EntitleResourceAsync(this ICloudServiceManagementClient operations, EntitleResourceParameters parameters) { return operations.EntitleResourceAsync(parameters, CancellationToken.None); }