I'm playing around with the new mvc web api and knockout.js and came across a scenario where $.getJSON is returning a deserialized object vs a json string. Not really a problem but I'm just curious as to why it's occurring. Can anyone explain? Thanks
//Web Api call
public UserViewModel GetNewUser()
{
var userViewModel = new UserViewModel()
{
Id = Guid.NewGuid(),
Name = "Test"
};
return userViewModel;
}
//client code
$.getJSON('/api/User/GetNewUser', function (result) {
//var viewModel = ko.mapping.fromJS(result);
//result is already parsed to ojbect
}
enter code here