/// <summary>
 /// Job collections can be updated through a simple PATCH operation.
 /// The format of the request is the same as that for creating a job,
 /// though if a field is unspecified we will carry forward the current
 /// value.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the Microsoft.WindowsAzure.Scheduler.IJobOperations.
 /// </param>
 /// <param name='parameters'>
 /// Parameters supplied to the Update Jobs State operation.
 /// </param>
 /// <returns>
 /// The Update Jobs State operation response.
 /// </returns>
 public static JobCollectionJobsUpdateStateResponse UpdateJobCollectionState(this IJobOperations operations, PatchJobCollectionJobsUpdateStateParameters parameters)
 {
     try
     {
         return(operations.UpdateJobCollectionStateAsync(parameters).Result);
     }
     catch (AggregateException ex)
     {
         if (ex.InnerExceptions.Count > 1)
         {
             throw;
         }
         else
         {
             throw ex.InnerException;
         }
     }
 }
 /// <summary>
 /// Job collections can be updated through a simple PATCH operation.
 /// The format of the request is the same as that for creating a job,
 /// though if a field is unspecified we will carry forward the current
 /// value.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the Microsoft.WindowsAzure.Scheduler.IJobOperations.
 /// </param>
 /// <param name='parameters'>
 /// Parameters supplied to the Update Jobs State operation.
 /// </param>
 /// <returns>
 /// The Update Jobs State operation response.
 /// </returns>
 public static Task <JobCollectionJobsUpdateStateResponse> UpdateJobCollectionStateAsync(this IJobOperations operations, PatchJobCollectionJobsUpdateStateParameters parameters)
 {
     return(operations.UpdateJobCollectionStateAsync(parameters, CancellationToken.None));
 }
Exemple #3
0
 /// <summary>
 /// Update the state of all jobs in a job collections.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the Microsoft.WindowsAzure.Scheduler.IJobOperations.
 /// </param>
 /// <param name='parameters'>
 /// Required. Parameters supplied to the Update Jobs State operation.
 /// </param>
 /// <returns>
 /// The Update Jobs State operation response.
 /// </returns>
 public static JobCollectionJobsUpdateStateResponse UpdateJobCollectionState(this IJobOperations operations, PatchJobCollectionJobsUpdateStateParameters parameters)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((IJobOperations)s).UpdateJobCollectionStateAsync(parameters);
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }