|
@@ -4,7 +4,6 @@ using System.Linq;
|
|
|
using System.Reflection;
|
|
|
using EdjCase.JsonRpc.Core;
|
|
|
using EdjCase.JsonRpc.Router.Abstractions;
|
|
|
-using JsonRPCTest.Controllers;
|
|
|
using Microsoft.Extensions.Logging;
|
|
|
using Microsoft.Extensions.Options;
|
|
|
using Newtonsoft.Json;
|
|
@@ -302,29 +301,21 @@ namespace EdjCase.JsonRpc.Router.Defaults
|
|
|
.ToDictionary(x => DefaultRequestMatcher.FixCase(x.Key) ?? x.Key, v => v.Value, StringComparer.OrdinalIgnoreCase);
|
|
|
ParameterInfo[] parameterInfoList = method.GetParameters();
|
|
|
parameterList = new object[parameterInfoList.Count()];
|
|
|
-
|
|
|
- foreach (ParameterInfo parameterInfo in parameterInfoList)
|
|
|
+ foreach (ParameterInfo parameterInfo in parameterInfoList)
|
|
|
+ {
|
|
|
+ if (!parametersMap.ContainsKey(parameterInfo.Name))
|
|
|
{
|
|
|
- if (!parametersMap.ContainsKey(parameterInfo.Name))
|
|
|
- {
|
|
|
- //if (parameterInfoList.Length == 1 && parametersMap != null && parametersMap.Keys.Count > 0)
|
|
|
- //{
|
|
|
- // Type type= parameterInfo.ParameterType;
|
|
|
- // parameterList[parameterInfo.Position] = JsonNetHelper.FromJson(parametersMap.ToJson(), type);
|
|
|
- // return true;
|
|
|
- //}
|
|
|
- if (!parameterInfo.IsOptional)
|
|
|
- {
|
|
|
- parameterList = null;
|
|
|
- return false;
|
|
|
- }
|
|
|
- }
|
|
|
- else
|
|
|
+ if (!parameterInfo.IsOptional)
|
|
|
{
|
|
|
- parameterList[parameterInfo.Position] = parametersMap[parameterInfo.Name];
|
|
|
+ parameterList = null;
|
|
|
+ return false;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+ else
|
|
|
+ {
|
|
|
+ parameterList[parameterInfo.Position] = parametersMap[parameterInfo.Name];
|
|
|
+ }
|
|
|
+ }
|
|
|
return true;
|
|
|
}
|
|
|
|