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 - Custom OutputStreamAppender not run: LOGBACK: No context given for <MYAPPENDER> -

java - UML - How would you draw a try catch in a sequence diagram? -

c++ - No viable overloaded operator for references a map -