title: Update entity on db with a property of list of entities with one-to-many relationship
body: <p>I will make up some simpler entities to get a better understanding:</p>
  
  <pre><code>public class Room
  {
      [Required]
      public int Id { get; set; }
  
      [Required]
      public int Name { get; set; }
  
      [Required]
      [Column("House_Id")]
      public int HouseId { get; set; }
      public virtual House House { get; set; }
  }
  
  
  public class House
  {
      [Required]
      public int Id{ get; set; }
  
      public string Name { get; set; }
  
      public virtual ICollection&lt;Room&gt; Rooms { get; set; }
  }
  </code></pre>
  
  <p>Now, lets say, that i have one House entity with 4 rooms related to it in database. I want to update the House and remove 2 of its rooms. I'm using Asp.Net MVC4 btw.</p>
  
  <pre><code>        var house = HouseRepository.Get(id);
          house.Name = model.Name; // Some string
          house.Name = model.Rooms; // ICollection&lt;Room&gt; from view with 2 rooms in it, cuz user deleted other two in view
          HouseRepository.SaveChanges();
          return house;
  </code></pre>
  
  <p>What happens, is that i get error saying : The operation failed: The relationship could not be changed because one or more of the foreign-key properties is non-nullable. When a change is made to a relationship, the related foreign-key property is set to a null value. If the foreign-key does not support null values, a new relationship must be defined, the foreign-key property must be assigned another non-null value, or the unrelated object must be deleted.</p>
  
  <p>I need to find a solution how to delete the unrelated Rooms from db. When and where i should do it? I've tried something already, but now i get that error even I'm adding rooms.</p>
  
  <p>Is there any simple way to tell EF that it should delete these rooms by itself?</p>