c# - Consolidating await statements -


i consolidate following statements 1 line.

var x = await a.method1async(); var y = await x.method2async(); var z = await y.method3async(); 

is possible remove intermediate objects , have in 1 line ?

you need parentheses:

var z = await (await (await a.method1async()).method2async()).method3async(); 

Comments

Popular posts from this blog

java - Ebean enhancement ignores a model -

javascript - Reference error while trying to encapsulate an animation function -

SQL php on different pages to Insert (mysqli) -