Skip to content
This repository has been archived by the owner on Aug 27, 2020. It is now read-only.

TaskExtensions

Mark Smith edited this page Aug 29, 2016 · 1 revision

TaskExtensions

A set of extension methods for the Task type.

Methods

  • IgnoreResult : useful to remove compiler warnings for a non-awaited Task. 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.