Click here to Skip to main content
15,884,838 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
In my single page web app, I use WebAPI to provide and save JSON data, which I display with knockout.
I have custom converter for my data too.

In case of invalid user input, my JsonConverter throw an exception, unfortunately the WebAPI method call DOESN'T fail and the invalid input is, instead, turned to null value.

i.e. my JSON data { ID:1, Time='dwehjkhwejk' }
becomes (in C#) new Data { ID = 1, Time = null };

Instead, I would like the exception thrown in my converter to make the API call fail!
How can I do that?
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900