title: Asp.net MVC, Razor & Entity Framework: Childobject lost id/relation
body: <p>I'm using a form to get some data from the user. The current userdata are loaded to the form as readonly fields and some other fields for user input.
  My model looks like this:</p>
  
  <pre><code>Mainobject
  -Field1
  -Field2
  ...
  -Userdataobject
      -Name
      -Street
  ...
  </code></pre>
  
  <p>The textfields in the form are bound to the model. The userdata are loaded from the database</p>
  
  <pre><code>Userdataobject userobj = (from c in _context.Userdataobejct where c.Id == someid select c).Single();
  Mainobject.Userdataobject = userobj;
  </code></pre>
  
  <p>If I submit the form to an action like </p>
  
  <pre><code>[HttpPost]
  public ActionResult SomeAction(Mainobject obj)
  ...
  </code></pre>
  
  <p>The childobject Userdataobject consists the data, but the id got lost???
  The problem is, that if I add the mainobject to the datacontext and save it, the Userdataobject will be created as a new item.</p>