title: Entity Framework POCO - Refresh a navigation property
body: <p>I am having some trouble with refreshing the related collection of entities.</p>
  
  <p>Essentially the problem is as follows:</p>
  
  <pre><code>public class Student
  {
      public virtual ICollection&lt;Lecture&gt; Lectures { get; set; }
  
      public void AddLecture(Lecture lecture)
      {
          Lectures.Add(lecture);
      }
  
      public void CancelChanges()
      {
          _context.Refresh(RefreshMode.StoreWins, this);
          _context.LoadProperty(this, (o) =&gt; o.Lectures, 
              MergeOption.OverwriteChanges);
      }
  }
  
  public class Grade
  {
      public virtual Student { get; set; }
  }
  </code></pre>
  
  <p>Now I have some GUI for adding lectures and, if we want we can cancel the editing process:</p>
  
  <pre><code>public void ExampleEdit()
  {
      Student student = _context.Students.SingleOrDefault(/* blah */);
      student.AddLecture(_context.Lectures.SingleOrDefault(/* e.g. math */));
      student.CancelChanges();
      // At this point student SHOULD have no lectures anymore since the 
      // property was loaded with overwrite changes option.
      // Yet the Lectures still contains the lecture we added there
  }
  </code></pre>
  
  <p>So, is the code bad? Is there any method I use incorrectly? Is it possible to COMPLETELY reload the whole object?..</p>