/// <summary> /// Get the list of all jobs in a job collection. /// </summary> /// <param name='operations'> /// Reference to the Microsoft.WindowsAzure.Scheduler.IJobOperations. /// </param> /// <param name='parameters'> /// Required. Parameters supplied to the List Jobs operation. /// </param> /// <returns> /// The List Jobs operation response. /// </returns> public static JobListResponse List(this IJobOperations operations, JobListParameters parameters) { return Task.Factory.StartNew((object s) => { return ((IJobOperations)s).ListAsync(parameters); } , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); }
/// <summary> /// Get the list of all jobs in a job collection. /// </summary> /// <param name='operations'> /// Reference to the Microsoft.WindowsAzure.Scheduler.IJobOperations. /// </param> /// <param name='parameters'> /// Required. Parameters supplied to the List Jobs operation. /// </param> /// <returns> /// The List Jobs operation response. /// </returns> public static Task<JobListResponse> ListAsync(this IJobOperations operations, JobListParameters parameters) { return operations.ListAsync(parameters, CancellationToken.None); }
/// <summary> /// Get the list of all jobs in a job collection. /// </summary> /// <param name='operations'> /// Reference to the Microsoft.WindowsAzure.Scheduler.IJobOperations. /// </param> /// <param name='parameters'> /// Parameters supplied to the List Jobs operation. /// </param> /// <returns> /// The List Jobs operation response. /// </returns> public static JobListResponse List(this IJobOperations operations, JobListParameters parameters) { try { return operations.ListAsync(parameters).Result; } catch (AggregateException ex) { if (ex.InnerExceptions.Count > 1) { throw; } else { throw ex.InnerException; } } }