Browse Source
Merge pull request #11587 from abpframework/liangshiwei/patch-1
Remove api-version if supported versions
pull/11595/head
maliming
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
7 additions and
4 deletions
-
framework/src/Volo.Abp.Http.Client/Volo/Abp/Http/Client/ClientProxying/ClientProxyBase.cs
|
|
|
@ -64,13 +64,16 @@ public class ClientProxyBase<TService> : ITransientDependency |
|
|
|
throw new AbpException($"The API description of the {typeof(TService).FullName}.{methodName} method was not found!"); |
|
|
|
} |
|
|
|
|
|
|
|
var actionArguments = action.Parameters.GroupBy(x => x.NameOnMethod).ToList(); |
|
|
|
if (action.SupportedVersions.Any()) |
|
|
|
{ |
|
|
|
//TODO: make names configurable
|
|
|
|
actionArguments.RemoveAll(x => x.Key == "api-version" || x.Key == "apiVersion"); |
|
|
|
} |
|
|
|
|
|
|
|
return new ClientProxyRequestContext( |
|
|
|
action, |
|
|
|
action.Parameters |
|
|
|
.GroupBy(x => x.NameOnMethod) |
|
|
|
//TODO: make names configurable
|
|
|
|
.Where(x => action.SupportedVersions.Any() && x.Key != "api-version" && x.Key !="apiVersion") |
|
|
|
actionArguments |
|
|
|
.Select((x, i) => new KeyValuePair<string, object>(x.Key, arguments.Values[i].Value)) |
|
|
|
.ToDictionary(x => x.Key, x => x.Value), |
|
|
|
typeof(TService)); |
|
|
|
|