/// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='employeeName'> /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <Manager> GetManagerAsync(this IContosoExpenseAPI operations, string employeeName, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.GetManagerWithHttpMessagesAsync(employeeName, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='employeeName'> /// </param> public static Manager GetManager(this IContosoExpenseAPI operations, string employeeName) { return(Task.Factory.StartNew(s => ((IContosoExpenseAPI)s).GetManagerAsync(employeeName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }