/// <summary> /// Method to execute a given batch /// </summary> /// <param name="batch">Batch to execute</param> /// <param name="throwOnError">Throw an exception on the first encountered error in the batch</param> /// <returns>The asynchronous task that will be executed</returns> public async Task <List <BatchResult> > ExecuteAsync(Batch batch, bool throwOnError = true) { if (batch == null) { throw new ArgumentNullException(nameof(batch)); } batch.ThrowOnError = throwOnError; return(await BatchClient.ExecuteBatch(batch).ConfigureAwait(false)); }
/// <summary> /// Method to execute the current batch /// </summary> /// <param name="throwOnError">Throw an exception on the first encountered error in the batch</param> /// <returns>The asynchronous task that will be executed</returns> public async Task <List <BatchResult> > ExecuteAsync(bool throwOnError = true) { CurrentBatch.ThrowOnError = throwOnError; return(await BatchClient.ExecuteBatch(CurrentBatch).ConfigureAwait(false)); }