Async Tip: why you should avoid void

added by DotNetKicks
3/14/2017 10:29:38 PM

2 Kicks, 313 Views

The guideline to prefer async method which return Task over async method that return void is quite known, but why should you follow the guideline? The first obvious reason to use the guideline is testability. When you return void the test don't really know when it is right time to check for the exception.