Solve the case of duplicate parameter types

pull/10139/head
maliming 4 years ago
parent 103250e53c
commit e821c8502c

@ -55,7 +55,7 @@ namespace Volo.Abp.Http.Client.ClientProxying
arguments = new ClientProxyRequestTypeValue();
}
var methodUniqueName = $"{typeof(TService).FullName}.{methodName}.{string.Join("-", arguments.Select(x => x.Key.FullName))}";
var methodUniqueName = $"{typeof(TService).FullName}.{methodName}.{string.Join("-", arguments.Values.Select(x => x.Key.FullName))}";
var action = ClientProxyApiDescriptionFinder.FindAction(methodUniqueName);
if (action == null)
{
@ -65,7 +65,7 @@ namespace Volo.Abp.Http.Client.ClientProxying
action,
action.Parameters
.GroupBy(x => x.NameOnMethod)
.Select((x, i) => new KeyValuePair<string, object>(x.Key, arguments.Values.Skip(i).FirstOrDefault()))
.Select((x, i) => new KeyValuePair<string, object>(x.Key, arguments.Values.Skip(i).First().Value))
.ToDictionary(x => x.Key, x => x.Value),
typeof(TService));
}

@ -3,8 +3,18 @@ using System.Collections.Generic;
namespace Volo.Abp.Http.Client.ClientProxying
{
public class ClientProxyRequestTypeValue : Dictionary<Type, object>
public class ClientProxyRequestTypeValue
{
public List<KeyValuePair<Type, object>> Values { get; private set; }
public ClientProxyRequestTypeValue()
{
Values = new List<KeyValuePair<Type, object>>();
}
public void Add(Type type, object value)
{
Values.Add(new KeyValuePair<Type, object>(type, value));
}
}
}

Loading…
Cancel
Save