Kelson.Common

Collection of packages published under the Kelson.Common namespace

View the Project on GitHub KelsonBall/Kelson.Common

Task of IEnumerable Extensions

Async proxies to common Linq methods

Task<T> SingleAsync<T>(this Task<IEnumerable<T>> source)

// using Kelson.Common.Async;

Task.Run(() => Enumerable.Range(0, 1)).SingleAsync()
> Task<int>(Result = "0")

Task<T> FirstAsync<T>(this Task<IEnumerable<T>> source)

// using Kelson.Common.Async;

Task.Run(() => Enumerable.Range(2, 4)).FirstAsync();
> Task<int>(Result = "2")

Task<IEnumerable<T>> WhereAsync<T>(this Task<IEnumerable<T>> source, Func<T, bool> predicate)

// using Kelson.Common.Async;

Task.Run(() => Enumerable.Range(2, 6)).WhereAsync(i => i % 2 == 0);
> Task<IEnumerable<int>>(Result = "Enumerable [2, 4, 6]")

Task<IEnumerable<T2>> SelectAsync<T, T2>(this Task<IEnumerable<T>> source, Func<T, T2> selector)

// using Kelson.Common.Async;

Task.Run(() => Enumerable.Range(1, 3)).SelectAsync(i => $"!{i.ToString()}!");
> Task<IEnumerable<int>>(Result = "Enumerable ["!1!", "!2!", "!3!"]")

Home