Skip to content

Commit 7b2893f

Browse files
committed
Merge branch 'master' of https://github.com/dotnetcore/WebApiClient into master
2 parents 60ad5cc + e6a84a6 commit 7b2893f

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

WebApiClientCore/BuildinAttributes/CancellationTokenTypeAttribute.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using System.Threading;
1+
using System.Collections.Generic;
2+
using System.Threading;
23
using System.Threading.Tasks;
34

45
namespace WebApiClientCore.Attributes
@@ -19,6 +20,13 @@ public override Task OnRequestAsync(ApiParameterContext context)
1920
{
2021
context.HttpContext.CancellationTokens.Add(token);
2122
}
23+
else if (context.ParameterValue is IEnumerable<CancellationToken> tokens)
24+
{
25+
foreach (var item in tokens)
26+
{
27+
context.HttpContext.CancellationTokens.Add(item);
28+
}
29+
}
2230
return Task.CompletedTask;
2331
}
2432
}

0 commit comments

Comments
 (0)