Swiss Army Knife
General utility tools for Scada Minds
Static Public Member Functions | List of all members
FluentTaskExtensions Class Reference

Bunch of extensions for Tasks to make LINQ-based syntax a bit prettier. E.g instead of (await foo()).Select(DoStuff) you can write await foo().Select(DoStuff). More...

Static Public Member Functions

static async Task< TOut > Select< TIn, TOut > (this Task< TIn > task, Func< TIn, TOut > selector)
 If you have an async function that returns a single element and you'd like to transform it before saving it, you can call this. await MyMethodAsync().Select(i => i + 2) is equivalent to (await MyMethodAsync()) + 2 you can call await MyMethodAsync().Select(/*...*‍/) instead of (await MyMethodAsync()).Select(/*...*‍/). More...
 
static async Task< IEnumerable< TOut > > Select< TIn, TOut > (this Task< IEnumerable< TIn >> task, Func< TIn, TOut > selector)
 If you have an async function that returns an IEnumerable you can transform it directly. await MyMethodAsync().Select(i => i + 2) is equivalent to (await MyMethodAsync()).Select(i => i + 2). More...
 
static async Task< IEnumerable< TOut > > Select< TIn, TOut > (this Task< TIn[]> task, Func< TIn, TOut > selector)
 If you have an async function that returns an array you can transform it directly. await MyMethodAsync().Select(i => i + 2) is equivalent to (await MyMethodAsync()).Select(i => i + 2). More...
 
static async Task< IEnumerable< TOut > > Select< TIn, TOut > (this Task< List< TIn >> task, Func< TIn, TOut > selector)
 If you have an async function that returns a List you can transform it directly. await MyMethodAsync().Select(i => i + 2) is equivalent to (await MyMethodAsync()).Select(i => i + 2). More...
 
static async Task< TOut > First< TOut > (this Task< IEnumerable< TOut >> task)
 If you have an async function you can call await MyMethodAsync().First() instead of (await MyMethodAsync()).First(). More...
 
static async Task< TOut > First< TOut > (this Task< TOut[]> task)
 If you have an async function you can call await MyMethodAsync().First() instead of (await MyMethodAsync()).First(). More...
 
static async Task< TOut > First< TOut > (this Task< List< TOut >> task)
 If you have an async function you can call await MyMethodAsync().First() instead of (await MyMethodAsync()).First(). More...
 
static async Task< IEnumerable< TOut > > SelectMany< TIn, TOut > (this Task< IEnumerable< TIn >> task, Func< TIn, IEnumerable< TOut >> selector)
 If you have an async function you can call await MyMethodAsync().SelectMany(/*...*‍/) instead of (await MyMethodAsync()).SelectMany(/*...*‍/). More...
 
static async Task< IEnumerable< TOut > > SelectMany< TIn, TOut > (this Task< List< TIn >> task, Func< TIn, IEnumerable< TOut >> selector)
 If you have an async function you can call await MyMethodAsync().SelectMany(/*...*‍/) instead of (await MyMethodAsync()).SelectMany(/*...*‍/). More...
 
static async Task< IEnumerable< TOut > > SelectMany< TIn, TOut > (this Task< TIn[]> task, Func< TIn, IEnumerable< TOut >> selector)
 If you have an async function you can call await MyMethodAsync().SelectMany(/*...*‍/) instead of (await MyMethodAsync()).SelectMany(/*...*‍/). More...
 
static async Task< List< TOut > > ToList< TOut > (this Task< IEnumerable< TOut >> task)
 If you have an async function you can call await MyMethodAsync().ToList() instead of (await MyMethodAsync()).ToList(). More...
 

Detailed Description

Bunch of extensions for Tasks to make LINQ-based syntax a bit prettier. E.g instead of (await foo()).Select(DoStuff) you can write await foo().Select(DoStuff).

Member Function Documentation

◆ First< TOut >() [1/3]

static async Task<TOut> First< TOut > ( this Task< IEnumerable< TOut >>  task)
static

If you have an async function you can call await MyMethodAsync().First() instead of (await MyMethodAsync()).First().

◆ First< TOut >() [2/3]

static async Task<TOut> First< TOut > ( this Task< List< TOut >>  task)
static

If you have an async function you can call await MyMethodAsync().First() instead of (await MyMethodAsync()).First().

◆ First< TOut >() [3/3]

static async Task<TOut> First< TOut > ( this Task< TOut[]>  task)
static

If you have an async function you can call await MyMethodAsync().First() instead of (await MyMethodAsync()).First().

◆ Select< TIn, TOut >() [1/4]

static async Task<IEnumerable<TOut> > Select< TIn, TOut > ( this Task< IEnumerable< TIn >>  task,
Func< TIn, TOut >  selector 
)
static

If you have an async function that returns an IEnumerable you can transform it directly. await MyMethodAsync().Select(i => i + 2) is equivalent to (await MyMethodAsync()).Select(i => i + 2).

◆ Select< TIn, TOut >() [2/4]

static async Task<IEnumerable<TOut> > Select< TIn, TOut > ( this Task< List< TIn >>  task,
Func< TIn, TOut >  selector 
)
static

If you have an async function that returns a List you can transform it directly. await MyMethodAsync().Select(i => i + 2) is equivalent to (await MyMethodAsync()).Select(i => i + 2).

◆ Select< TIn, TOut >() [3/4]

static async Task<TOut> Select< TIn, TOut > ( this Task< TIn >  task,
Func< TIn, TOut >  selector 
)
static

If you have an async function that returns a single element and you'd like to transform it before saving it, you can call this. await MyMethodAsync().Select(i => i + 2) is equivalent to (await MyMethodAsync()) + 2 you can call await MyMethodAsync().Select(/*...*‍/) instead of (await MyMethodAsync()).Select(/*...*‍/).

◆ Select< TIn, TOut >() [4/4]

static async Task<IEnumerable<TOut> > Select< TIn, TOut > ( this Task< TIn[]>  task,
Func< TIn, TOut >  selector 
)
static

If you have an async function that returns an array you can transform it directly. await MyMethodAsync().Select(i => i + 2) is equivalent to (await MyMethodAsync()).Select(i => i + 2).

◆ SelectMany< TIn, TOut >() [1/3]

static async Task<IEnumerable<TOut> > SelectMany< TIn, TOut > ( this Task< IEnumerable< TIn >>  task,
Func< TIn, IEnumerable< TOut >>  selector 
)
static

If you have an async function you can call await MyMethodAsync().SelectMany(/*...*‍/) instead of (await MyMethodAsync()).SelectMany(/*...*‍/).

◆ SelectMany< TIn, TOut >() [2/3]

static async Task<IEnumerable<TOut> > SelectMany< TIn, TOut > ( this Task< List< TIn >>  task,
Func< TIn, IEnumerable< TOut >>  selector 
)
static

If you have an async function you can call await MyMethodAsync().SelectMany(/*...*‍/) instead of (await MyMethodAsync()).SelectMany(/*...*‍/).

◆ SelectMany< TIn, TOut >() [3/3]

static async Task<IEnumerable<TOut> > SelectMany< TIn, TOut > ( this Task< TIn[]>  task,
Func< TIn, IEnumerable< TOut >>  selector 
)
static

If you have an async function you can call await MyMethodAsync().SelectMany(/*...*‍/) instead of (await MyMethodAsync()).SelectMany(/*...*‍/).

◆ ToList< TOut >()

static async Task<List<TOut> > ToList< TOut > ( this Task< IEnumerable< TOut >>  task)
static

If you have an async function you can call await MyMethodAsync().ToList() instead of (await MyMethodAsync()).ToList().


The documentation for this class was generated from the following file: