diff --git a/dotnet/src/dotnetframework/GxClasses/Services/ReflectionHelper.cs b/dotnet/src/dotnetframework/GxClasses/Services/ReflectionHelper.cs index b7dde1720..8cd27f4b5 100644 --- a/dotnet/src/dotnetframework/GxClasses/Services/ReflectionHelper.cs +++ b/dotnet/src/dotnetframework/GxClasses/Services/ReflectionHelper.cs @@ -14,8 +14,8 @@ namespace GeneXus.Application { public class ReflectionHelper - { - const string ISO_8601_TIME_SEPARATOR= "T"; + { + const string ISO_8601_TIME_SEPARATOR = "T"; const string ISO_8601_TIME_SEPARATOR_1 = ":"; public static void CallBCMethod(object instance, String methodName, IList inParametersValues) { @@ -43,7 +43,8 @@ public static Dictionary CallMethodPattern(object instance, Stri MethodInfo methodInfo = instanceType.GetMethod(memberInfo.Name, BindingFlags.Instance | BindingFlags.Public | BindingFlags.IgnoreCase); return CallMethodImpl(instance, methodInfo, parameters, context); } - public static Dictionary CallMethod(object instance, String methodName, IDictionary parameters, IGxContext context=null) + + public static Dictionary CallMethod(object instance, String methodName, IDictionary parameters, IGxContext context = null) { MethodInfo methodInfo = instance.GetType().GetMethod(methodName, BindingFlags.Instance | BindingFlags.Public | BindingFlags.IgnoreCase); return CallMethodImpl(instance, methodInfo, parameters, context); @@ -80,17 +81,26 @@ public static Dictionary GetWrappedParameter(object instance, St inputParameters.Add(methodParameter); } } - if (inputParameters.Count == 1 && bodyParameters.Count>1) + if (inputParameters.Count == 1) { - ParameterInfo pInfo = inputParameters[0]; - if (pInfo.ParameterType.IsSubclassOf(typeof(GxUserType))) + ParameterInfo pInfo = inputParameters[0]; + if (pInfo.ParameterType.IsSubclassOf(typeof(GxUserType)) && bodyParameters.Count > 1) { - var gxParameterName = GxParameterName(pInfo.Name).ToLower(); - Dictionary parameters = new Dictionary(); - JObject jparms = new JObject(bodyParameters); + string gxParameterName = GxParameterName(pInfo.Name).ToLower(); + Dictionary parameters = new Dictionary(); + JObject jparms = new JObject(bodyParameters); parameters.Add(gxParameterName, jparms); - return parameters; + return parameters; + } + if (typeof(IGxCollection).IsAssignableFrom(pInfo.ParameterType) && bodyParameters.Count == 1 && bodyParameters.ContainsKey(string.Empty) && bodyParameters[string.Empty] is JArray) + { + string gxParameterName = GxParameterName(pInfo.Name).ToLower(); + Dictionary parameters = new Dictionary(); + parameters.Add(gxParameterName, bodyParameters[string.Empty]); + return parameters; + } + } return bodyParameters; }