title: Adding Data to a very nested child object using EntityFramework
body: <p><img src="https://i.stack.imgur.com/zINl8.png" alt="enter image description here"></p>
  
  <p>I am trying to add a note to my event object. I am getting an error using this code </p>
  
  <pre><code>  Note noteToAdd = new Note { State = State.Added, NoteText = note };
    Patient patient = context.Patients.Find(patientId);
    patient.State = State.Modified;
    patient.MobilePatient.State = State.Modified;
    patient.MobilePatient.MCalmEvents.Find(e =&gt; e.Id == eventid).Note = noteToAdd;
    context.ApplyStateChanges();
  </code></pre>
  
  <p>Is there a better way to do it using Linq To Entity?</p>
  
  <p>The error that I am having is :</p>
  
  <blockquote>
    <p>{"Invalid column name 'Note_Id'."}</p>
  </blockquote>
  
  <p>and the SQl that is being generated is a SELECT instead of INSERT.</p>
  
  <p>Thank you</p>