throw error: System.Exception:“Argument 'left' not found”
Your code piece
[FunctionDescription("Add new Widget")]
public string AddWidgetFunction(
[ParameterDescription(Description = "Widget Type Parameter", Required = true)] WidgetTypeEnum widgetType,
[ParameterDescription(Description = "Left Parameter", Required = false)] double left,
[ParameterDescription(Description = "Top Parameter", Required = false)] double top,
[ParameterDescription(Description = "Width Parameter", Required = false)] double width,
[ParameterDescription(Description = "Height Parameter", Required = false)] double height
)
{
return "finish";
}
//------------------------
var obj = new UIFunctionCallingClass();
var functionCall = new FunctionCall
{
Name = "AddWidgetFunction",
Arguments = "{\"widgetType\":\"Rectangle\"}"
};
FunctionCallingHelper.CallFunction<string>(functionCall, obj);
Result
More detail about what happened when you run your code.
throw error: System.Exception:“Argument 'left' not found”
Expected behavior
A clear and concise description of what you expected to happen.
Required = false
means you can add the Arguments = "{\"widgetType\":\"Rectangle\",\"left\":30.0}"
or Arguments = "{\"widgetType\":\"Rectangle\"}"
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
OS: [e.g. Windows]
Language [e.g. c#]
Version [e.g. 0.0.3]
Additional context
Add any other context about the problem here.
Describe the bug A clear and concise description of what the bug is.
[ParameterDescription(Description = "Left Parameter", Required = false)] double left,
throw error: System.Exception:“Argument 'left' not found”
Your code piece
Result More detail about what happened when you run your code. throw error: System.Exception:“Argument 'left' not found”
Expected behavior A clear and concise description of what you expected to happen. Required = false
means you can add the Arguments = "{\"widgetType\":\"Rectangle\",\"left\":30.0}" or Arguments = "{\"widgetType\":\"Rectangle\"}"
Screenshots If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Additional context Add any other context about the problem here.