title: ASP.NET MVC - Submit Form with complex Model with EntitySet
body: <p>I'm struggling myself trying to make my form work with my models...</p>
  
  <p>So, I have 3 Models</p>
  
  <pre><code>Account
    has_one  -&gt; Company
    has_many -&gt; Individuals -&gt; has_one Document
  </code></pre>
  
  <p>So the account can have one company and many individuals with one document each.</p>
  
  <p>When submit my forms I have the following action</p>
  
  <pre><code>[AcceptVerbs(HttpVerbs.Post)]
  public ActionResult OpenAnAccount(string area, [Bind(Exclude = "Id")] Website.Model.Account account)
  {
    var db = new DB();
  
    var type = new int();
  
    switch (area)
    {
        case "business": type = 1; break;
        case "private": type = 2; break;
    }
  
    if (ModelState.IsValid)
    {
        try
        {
           account.Type = type;
           db.Accounts.InsertOnSubmit(account);
           db.SubmitChanges();
           return View("OpenAnAccount/ThankYou");
        }
        catch
        {
           return View();
        }
    }
    else
    {
       return View();
    }    
  }
  </code></pre>
  
  <p>And on my form simple things like</p>
  
  <pre><code>%label{for='companyName'} &lt;em&gt;*&lt;/em&gt;Company Name
  %input{class='required' id='companyName' name='Company.Name' type='text'}
  %label{for='companyTradeName'}Trading As (if Different)
  %input{id='companyTradeName' name='Company.Trade' type='text'}
  %label{for='companyRegistrationNumber'} &lt;em&gt;*&lt;/em&gt;Company Registration Number
  %input{class='required' id='companyRegistrationNumber' name='Company.Registration' type='text'}
  %label{for='vatNumber'}VAT Number (if Applicable)
  %input{id='vatNumber' name='Company.VAT' type='text'}
  </code></pre>
  
  <p>Which means I am naming the fields as Company.Name, Company.Registration, etc...
  and for the individuals I'm doing like this</p>
  
  <pre><code>%label{for ='firstName_0'} &lt;em&gt;*&lt;/em&gt;First Name
  %input#firstName_0.required.firstName{ name='Individuals[0].FirstName' type='text'}
  %label{for='middleName_0'} Middle Name
  %input#middleName_0{ name='Individuals[0].MiddleName' type='text'}
  %label{for='lastName_0'} &lt;em&gt;*&lt;/em&gt;Last Name
  %input#lastName_0.required{ name='Individuals[0].LastName' type='text'}
  </code></pre>
  
  <p>as Individuals[0].FirstName, Individuals[0].LastName, etc</p>
  
  <p>But what is happening is that I'm indeed getting the account generation with my company, but it's not working for the Individuals....its not doing anything with the database?</p>
  
  <p>Anyone could help me on that?</p>
  
  <p>I've checked some resources like this <a href="http://haacked.com/archive/2008/10/23/model-binding-to-a-list.aspx" rel="nofollow noreferrer">http://haacked.com/archive/2008/10/23/model-binding-to-a-list.aspx</a> but it doesn't work in my case I suppose, because it didn't change anything.</p>
  
  <p>Thanks in advance</p>