title: What is the best way to handle creating, and updating Complex Datatypes in MVC3?
body: <p>Ok I've been trying to figure out the best way to do this for a few days, but still haven't come up with a very elegant answer so am hoping I someone can point me in the right direction or give some peer review :)</p>
  
  <p>Basically I have 3 classes (they are different and much more complex than these):</p>
  
  <pre><code>public class Person
  {
      int ID { get; set;}
      string Name { get; set; }
      virtual IEnumerable&lt;Place&gt; { get; set; }
  
  }
  
  public class Place
  {
      int ID { get; set;}
      string Name { get; set; }
      virtual IEnumerable&lt;Thing&gt; { get; set; }
  }
  
  public class Thing
  {
      int ID { get; set;}
      string Name { get; set; }
      virtual IEnumerable&lt;Place&gt; { get; set; }
      virtual int PersonID { get; set; }
  }
  </code></pre>
  
  <p>So basically you have <code>Person</code>s, who have many <code>Place</code>s, which can have many <code>Thing</code>s which can also appear in multiple <code>Places</code> (trying to reduce having to store duplicates of <code>Thing</code>s) but only for that <code>Person</code></p>
  
  <p>What is the best way to setup my ViewModel to handle this? Should I just create everything by itself using Ajax and Json (what I've been doing) or is there a way to handle this type of relationship in a ViewModel and single post back to the server?</p>
  
  <p>Currently I'm doing the following:</p>
  
  <p>Fill out <code>Person</code> form -> ajax save to server, get <code>Person ID</code></p>
  
  <p>Fill out <code>Place</code> form (including <code>Person</code>'s <code>ID</code>) -> ajax save to server, get <code>Place ID</code></p>
  
  <p>Fill out <code>Thing</code> form (including <code>Person ID</code> and <code>Place ID</code>s in a delimited string</p>
  
  <p>I know there should be an easier way to do this as its kinda bulky, but since its all query string I can't figure it out</p>