title: Passing dynamic json object to C# MVC controller
body: <p>I am doing some work with .Net 4, MVC 3 and jQuery v1.5</p>
  
  <p>I have a JSON object that can change depending on which page is calling it. I'd like to pass the object to a controller.</p>
  
  <pre><code>{ id: 1, title: "Some text", category: "test" }
  </code></pre>
  
  <p>I understand that if I create a custom model such as</p>
  
  <pre><code>[Serializable]
  public class myObject
  {
      public int id { get; set; }
      public string title { get; set; }
      public string category { get; set; }
  }
  </code></pre>
  
  <p>and use this in my controller such as</p>
  
  <pre><code>public void DoSomething(myObject data)
  {
      // do something
  }
  </code></pre>
  
  <p>and pass the object using jQuery's .ajax method like this:</p>
  
  <pre><code>$.ajax({ 
      type: "POST", 
      url: "/controller/method", 
      myjsonobject,  
      dataType: "json", 
      traditional: true
  });
  </code></pre>
  
  <p>This works fine, my JSON object is mapped to my C# object. What I'd like to do is pass through a JSON object that's likely to change. When it changes I don't want to have to add items to my C# model each time the JSON object changes.</p>
  
  <p>Is this actually possible? I tried mapping objects to a Dictionary but the value of data would just end up being null.</p>
  
  <p>Thanks</p>