-
Notifications
You must be signed in to change notification settings - Fork 0
TaskExtensions
Mark Smith edited this page Aug 26, 2016
·
4 revisions
A set of extension methods for the Task type.
-
IgnoreResult: useful to remove compiler warnings for a non-awaitedTask. This will output any errors to the debug console and allows an optional handler to be wired up to handle exceptions that occur from the task result.
Task.Run(() => ...)
<mark>.IgnoreResult(ex =>
{
// Handle exception here.
});</mark>
Task.Run(() => ...).IgnoreResult(); // exceptions ignored.