Skip to content

Commit

Permalink
Merge branch 'main' into extendable-client
Browse files Browse the repository at this point in the history
  • Loading branch information
twogood authored Nov 26, 2024
2 parents 09cd534 + a2ae62b commit e94b22c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 15 deletions.
4 changes: 3 additions & 1 deletion Activout.RestClient/Activout.RestClient.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<LangVersion>default</LangVersion>
<PackageReadmeFile>README.md</PackageReadmeFile>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="ImpromptuInterface" Version="8.0.4" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="9.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="8.0.1" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="System.Linq" Version="4.3.0" />
<None Include="README.md" Pack="true" PackagePath="\"/>
</ItemGroup>
</Project>
15 changes: 1 addition & 14 deletions Activout.RestClient/Helpers/Implementation/TaskConverter3.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
using System;
using System.Diagnostics;
using System.Threading.Tasks;

namespace Activout.RestClient.Helpers.Implementation;

/*
* Convert from Task<object> to Task<T> where T is the Type
*
* Implemented by creating a TaskCompletionSource<T> and setting the result or exception
*/
public class TaskConverter3<T> : ITaskConverter
{
Expand All @@ -20,16 +17,6 @@ public object ConvertReturnType(Task<object> task)
[StackTraceHidden]
private static async Task<T> ConvertReturnTypeImpl(Task<object> task)
{
var taskCompletionSource = new TaskCompletionSource<T>();
try
{
taskCompletionSource.SetResult((T)await task);
}
catch (Exception e)
{
taskCompletionSource.SetException(e);
}

return await taskCompletionSource.Task;
return (T)await task;
}
}
1 change: 1 addition & 0 deletions Activout.RestClient/README.md

0 comments on commit e94b22c

Please sign in to comment.