Async methods which only call one async method #5722
Unanswered
TahirAhmadov
asked this question in
Q&A
Replies: 1 comment
-
Not a language question. Note that this can very much affect things like how exceptions work. Imagine if you have: async Task Bar(string s!!)
{
await Foo();
}
// or
Task Bar2(string s!!)
{
return Foo();
} In the first, if you pass null to These are very different semantics and your code needs be careful here around how exception flow is managed. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Imagine this:
Which one is preferable,
Bar
orBar2
? I imagineBar
has a performance overhead because it'll create the state machine, but the question is, is that considered a serious penalty to avoid? On the other hand, are there downsides toBar2
? Is debugging negatively impacted?Beta Was this translation helpful? Give feedback.
All reactions