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

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

java - Custom OutputStreamAppender not run: LOGBACK: No context given for <MYAPPENDER> -

java - Cannot secure connection using TLS -