Пример #1
0
        /// <summary>
        /// Runs the collection work.
        /// </summary>
        /// <param name="args">The <see cref="ExecutorCollectionRunArgs{TArgs}"/>.</param>
        /// <returns>The collection.</returns>
        internal async Task <TColl> RunCollectionAsync(ExecutorCollectionRunArgs args)
        {
            try
            {
                var coll = await OnRunCollectionAsync(args).ConfigureAwait(false);

                OnPerRunType(args);
                return(coll);
            }
            catch (Exception ex)
            {
                if (!args.HasException)
                {
                    args.SetException(ex);
                    OnPerRunType(args);
                }

                throw;
            }
        }
Пример #2
0
 /// <summary>
 /// Runs the collection unit of work.
 /// </summary>
 /// <param name="args">The <see cref="ExecutorCollectionRunArgs{TArgs}"/>.</param>
 /// <returns>The <see cref="IEnumerable{TItem}"/>.</returns>
 protected abstract Task <TColl> OnRunCollectionAsync(ExecutorCollectionRunArgs args);