diff --git a/Activout.RestClient/Helpers/Implementation/TaskConverter3.cs b/Activout.RestClient/Helpers/Implementation/TaskConverter3.cs index 7e98bf6..ec26350 100644 --- a/Activout.RestClient/Helpers/Implementation/TaskConverter3.cs +++ b/Activout.RestClient/Helpers/Implementation/TaskConverter3.cs @@ -1,4 +1,3 @@ -using System; using System.Diagnostics; using System.Threading.Tasks; @@ -6,8 +5,6 @@ namespace Activout.RestClient.Helpers.Implementation; /* * Convert from Task to Task where T is the Type - * - * Implemented by creating a TaskCompletionSource and setting the result or exception */ public class TaskConverter3 : ITaskConverter { @@ -20,16 +17,6 @@ public object ConvertReturnType(Task task) [StackTraceHidden] private static async Task ConvertReturnTypeImpl(Task task) { - var taskCompletionSource = new TaskCompletionSource(); - try - { - taskCompletionSource.SetResult((T)await task); - } - catch (Exception e) - { - taskCompletionSource.SetException(e); - } - - return await taskCompletionSource.Task; + return (T)await task; } } \ No newline at end of file