RESTier
RESTier copied to clipboard
Bug: need support optional parameters in operation
As we known, OData WebAPI support optional parameters for function or action.
link1
link2
In current Restier version, I can not use this feature.
RESTier 1.0 RC1
Reproduce steps
-
create two methods in API class`
[Operation()] public IEnumerable<Employee> Query31(int? parameter1) => null; [Operation()] public IEnumerable<Employee> Query32(int? parameter1 = null) => null;`
2)Test function at the front
http://localhost:18862/ApplicationData/Query32(parameter1=1) --> OK
http://localhost:18862/ApplicationData/Query32(parameter1=null) --> error
I have tried other possibilities, but failed. I traced sourcecode, and found in edm model generated automatically the Nullable attribute for this parameter is false, so throw exception when convert it to clr type.
any idea? Thanks in advance.