use default value of parameter if available
This commit is contained in:
@@ -551,6 +551,8 @@ public class ApiServer : IApiServer
|
||||
objs.Add(Convert.ChangeType(HttpUtility.UrlDecode(parameterValue), info.ParameterType)); // or Uri.UnescapeDataString(); maybe run this line twice?
|
||||
else if (queryparams.AllKeys.FirstOrDefault(n => n != null && n.Equals(info.Name, StringComparison.InvariantCultureIgnoreCase)) is string querykey)
|
||||
objs.Add(Convert.ChangeType(HttpUtility.UrlDecode(queryparams.Get(querykey)), info.ParameterType));
|
||||
else if (info.HasDefaultValue)
|
||||
objs.Add(info.DefaultValue);
|
||||
else
|
||||
objs.Add(null);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user