I am using knockout and the model I'm using has alot of items in it. I am posting it to a controller like so:
ajaxRequest("post", "/api/care/saveevent?student=" + self.StudentId(),self.CurrentEvent())
.done(function (allData) {
alert("ran ok");
})
.fail(function () {
alert("An error occurred");
});
And my controller has this:
public string SaveEvent(object data, int student)
{
return "test";
}
I want to use object so that I don't have to replicate everything in the knockout model on the controller or anywhere else so I can modify it once.
It posts ok and when debugging everything in the object data is correct. However I don't use object normally and not sure how to get it's contents as is, simply putting data.PropertyName causes intellisense errors.
What's the correct way to get its contents and is what I'm trying to do impossible?