public static async Task <Result <IEnumerable <T>, E> > Combine <T, E>(this Task <IEnumerable <Task <Result <T, E> > > > task)
            where E : ICombine
        {
            IEnumerable <Task <Result <T, E> > > tasks = await task.ConfigureAwait(Result.DefaultConfigureAwait);

            return(await tasks.Combine().ConfigureAwait(Result.DefaultConfigureAwait));
        }
        public static async Task <Result <K, E> > Combine <T, K, E>(this Task <IEnumerable <Task <Result <T, E> > > > task, Func <IEnumerable <T>, K> composer)
            where E : ICombine
        {
            IEnumerable <Task <Result <T, E> > > tasks = await task.ConfigureAwait(Result.DefaultConfigureAwait);

            return(await tasks.Combine(composer).ConfigureAwait(Result.DefaultConfigureAwait));
        }
 public static ConfiguredTaskAwaitable <T> DefaultAwait <T>(this Task <T> task) => task.ConfigureAwait(Result.DefaultConfigureAwait);
Beispiel #4
0
        public static async Task <Result <K> > Combine <T, K>(this Task <IEnumerable <Task <Result <T> > > > task, Func <IEnumerable <T>, K> composer, string errorMessageSeparator = null)
        {
            IEnumerable <Task <Result <T> > > tasks = await task.ConfigureAwait(Result.DefaultConfigureAwait);

            return(await tasks.Combine(composer, errorMessageSeparator).ConfigureAwait(Result.DefaultConfigureAwait));
        }
Beispiel #5
0
        public static async Task <Result> Combine(this Task <IEnumerable <Task <Result> > > task, string errorMessageSeparator = null)
        {
            IEnumerable <Task <Result> > tasks = await task.ConfigureAwait(Result.DefaultConfigureAwait);

            return(await tasks.Combine(errorMessageSeparator).ConfigureAwait(Result.DefaultConfigureAwait));
        }
        public static async Task <Result <IEnumerable <T>, E> > Combine <T, E>(this Task <IEnumerable <Task <Result <T, E> > > > task, Func <IEnumerable <E>, E> composerError)
        {
            IEnumerable <Task <Result <T, E> > > tasks = await task.ConfigureAwait(Result.DefaultConfigureAwait);

            return(await tasks.Combine(composerError).ConfigureAwait(Result.DefaultConfigureAwait));
        }