title: Removing all records from navigation properties in Entity Framework
body: <p>I have 1:N relationship between Program and Student tables which EF converted into navigation property. Now I want to delete all those records in this navigation students.
  I started like this:</p>
  
  <pre><code>foreach(Student student in program.Students)
  program.Students.Remove(student);
  </code></pre>
  
  <p>But I am a little bit skeptical about this.</p>
  
  <p>Than I tried this way:</p>
  
  <pre><code>while (program.Students.Count &gt; 0)
      program.Students.Remove(program.Students.ToList()[0]);
  </code></pre>
  
  <p>But this seems weird too.</p>
  
  <p>Is there some simpler way to do this or if not which way is the best?</p>