May 1, 2012 at 7:17 PM
Edited May 1, 2012 at 7:18 PM
|
For me it was not realizing that I was not using the correct parameters in the POST method in my ApiController. I was trying to have JSON.net serialize an object to a parameter in my method that was an Int value.
Had this as my method before that didn't work and I couldn't figure out why it was trying to serialize to an Int:
public HttpResponseMessage<NewsCategory> Post(int employee, NewsCategory category) { ... code to save to database ... }
Changed the method to this and was able to successfully post to the database.
public HttpResponseMessage<NewsCategory> Post(NewsCategory category) {... code to save in the database ...}
Hope that this helps. Please feel free to respond back with some code if you need some further help.
|