TaskExtensions - markjulmar/xamu-infrastructure GitHub Wiki
TaskExtensions
A set of extension methods for the Task type.
Methods
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.
Examples
Task.Run(() => ...)
.IgnoreResult(ex =>
{
// Handle exception here.
});
Task.Run(() => ...).IgnoreResult(); // exceptions ignored.