Created
March 6, 2019 20:27
-
-
Save felipeslongo/125dd22b52ca7ee0fe7f9d856c9a9637 to your computer and use it in GitHub Desktop.
Task FireAndForget Extension Method
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static async void FireAndForget(this Task task) | |
{ | |
try | |
{ | |
await task; | |
} | |
catch (Exception e) | |
{ | |
// log errors | |
} | |
} | |
//https://stackoverflow.com/questions/12803012/fire-and-forget-with-async-vs-old-async-delegate |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment