From a0c3c0f33f389115471bae06b6ca67bf294b54c3 Mon Sep 17 00:00:00 2001 From: James South Date: Mon, 9 Jun 2014 02:25:34 +0100 Subject: [PATCH] Switching out awaitables to recommended method. Former-commit-id: 219178b53a0764f707a288d0822871abaff28203 --- src/ImageProcessor.Web/NET45/Helpers/TaskHelpers.cs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/ImageProcessor.Web/NET45/Helpers/TaskHelpers.cs b/src/ImageProcessor.Web/NET45/Helpers/TaskHelpers.cs index b4f3397942..961498c09f 100644 --- a/src/ImageProcessor.Web/NET45/Helpers/TaskHelpers.cs +++ b/src/ImageProcessor.Web/NET45/Helpers/TaskHelpers.cs @@ -30,9 +30,7 @@ namespace ImageProcessor.Web.Helpers /// public static Task Run(Action action) { - Task task = new Task(action); - task.Start(); - return task; + return Task.Factory.StartNew(action); } /// @@ -47,9 +45,7 @@ namespace ImageProcessor.Web.Helpers /// public static Task Run(Func function) { - Task task = new Task(function); - task.Start(); - return task; + return Task.Factory.StartNew(function); } } }