title: how to pass knockoutjs view model into a mvc controller
body: <p>I have the following function in a MVC controller</p>
  
  <pre><code>public class XyzController:Controller
  {
      public ActionResult Index(){...}
      [HttpPost]
      public bool Save(string jsondata)
      {
  
          //parse json data to insert into the database
      }
  }
  </code></pre>
  
  <p>I want to pass this view model into the Save function</p>
  
  <pre><code>var myObj = function (id) {
      var self = this;
      self.myId = id;    
      self.parameters = ko.observableArray();    
  }
  
  var ViewModel = function () {
      var self = this;       
      self.myObjList = ko.observableArray();
      self.sendItems = function() {
               $.ajax({
                       type: "POST",
                       url: '/Xyz/Save',
                       data: ko.toJSON(self),
                       contentType: "application/json; charset=utf-8",
                       dataType: "json",
                       success: function (response) {
                               alert(response);
                       },
                       error: function (request, status, error) {
                              alert(request.statusText);
                       }
               });
      }
  }
  
  var vm = new ViewModel()
  ko.applyBindings(vm);
  </code></pre>
  
  <p>I do get the data if I pass the data as JSON.stringify({jsondata:ko.toJSON(self)}), but how do I then convert it into a object so that I can iterate over the myObjList and the parameters?</p>