/// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Monitoring.Autoscale.ISettingOperations.
 /// </param>
 /// <param name='resourceId'>
 /// Required. The resource ID.
 /// </param>
 /// <param name='parameters'>
 /// Required. Parameters supplied to the operation.
 /// </param>
 /// <returns>
 /// A standard service response including an HTTP status code and
 /// request ID.
 /// </returns>
 public static OperationResponse CreateOrUpdate(this ISettingOperations operations, string resourceId, AutoscaleSettingCreateOrUpdateParameters parameters)
 {
     return Task.Factory.StartNew((object s) => 
     {
         return ((ISettingOperations)s).CreateOrUpdateAsync(resourceId, parameters);
     }
     , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
 }
コード例 #2
0
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Monitoring.Autoscale.ISettingOperations.
 /// </param>
 /// <param name='resourceId'>
 /// The resource ID.
 /// </param>
 /// <param name='parameters'>
 /// Parameters supplied to the operation.
 /// </param>
 /// <returns>
 /// A standard service response including an HTTP status code and
 /// request ID.
 /// </returns>
 public static OperationResponse CreateOrUpdate(this ISettingOperations operations, string resourceId, AutoscaleSettingCreateOrUpdateParameters parameters)
 {
     try
     {
         return operations.CreateOrUpdateAsync(resourceId, parameters).Result;
     }
     catch (AggregateException ex)
     {
         if (ex.InnerExceptions.Count > 1)
         {
             throw;
         }
         else
         {
             throw ex.InnerException;
         }
     }
 }
コード例 #3
0
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Monitoring.Autoscale.ISettingOperations.
 /// </param>
 /// <param name='resourceId'>
 /// The resource ID.
 /// </param>
 /// <param name='parameters'>
 /// Parameters supplied to the operation.
 /// </param>
 /// <returns>
 /// A standard service response including an HTTP status code and
 /// request ID.
 /// </returns>
 public static Task<OperationResponse> CreateOrUpdateAsync(this ISettingOperations operations, string resourceId, AutoscaleSettingCreateOrUpdateParameters parameters)
 {
     return operations.CreateOrUpdateAsync(resourceId, parameters, CancellationToken.None);
 }