I have this property
public int? CodigoBanco { get; set; }
An when i try to send it to server in this way
codigoBanco: ""
I have the following error
The following errors were detected during validation:\r\n - The JSON value could not be converted to System.Nullable`1[System.Int32]
You have two ways to resolve the problem:
Specify null
(not empty string) and it will be successfully mapped. codigoBanco: null
or remove this property at all from client-side(the default will be the same null
)
Write custom convertaion at backend-side, something like:
CodigoBanco = int.Parse(codigoBanco == "" || codigoBanco.Length = 0 ? null : codigoBanco);