This should almost never exist:
async void DoWork()
❌ Why it’s dangerous
-
Exceptions crash the process
-
Cannot be awaited
-
Impossible to test
✅ Correct
async Task DoWorkAsync()
Only valid use: event handlers.
Daily micro-tips for C#, SQL, performance, and scalable backend engineering.
This should almost never exist:
async void DoWork()
Exceptions crash the process
Cannot be awaited
Impossible to test
async Task DoWorkAsync()
Only valid use: event handlers.