title: In EF, is it efficient to delete a parent row by deleting the child rows referencing it first through the child row clones?
body: <pre><code>        public void Delete(Dinner dinner)
          {
              List&lt;RSVP&gt; rsvps = dinner.RSVPs.ToList();// This clone looks inefficient.
  
              foreach (RSVP rsvp in rsvps)
                  entities.RSVPs.DeleteObject(rsvp);
  
              entities.Dinners.DeleteObject(dinner);
          }
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/siXfN.jpg" alt="alt text"></p>
  
  <p><strong>QUESTION:</strong></p>
  
  <p>Deleting a parent row by deleting the child rows referencing it first through the child row clones looks inefficient.</p>
  
  <p>Duplicating the child rows will consume huge resources I think.</p>
  
  <p>If so, what is the better way?</p>
  
  <p><strong>EDIT 1:</strong></p>
  
  <pre><code>namespace NerdDinner.Models
  {
      public class DinnerRepository
      {
          private NerdDinnerEntities entities = new NerdDinnerEntities();
  
          public IQueryable&lt;Dinner&gt; FindAllDinners()
          {
              return entities.Dinners;
          }
  
          public IQueryable&lt;Dinner&gt; FindUpcomingDinners()
          {
              return from dinner in entities.Dinners
                     where dinner.EventDate &gt; DateTime.Now
                     orderby dinner.EventDate
                     select dinner;
          }
  
          public Dinner GetDinnerByID(int DinnerID)
          {
              return entities.Dinners.FirstOrDefault(d =&gt; d.DinnerID == DinnerID);
          }
  
          public void Add(Dinner dinner)
          {
              entities.Dinners.AddObject(dinner);
          }
  
          public void Delete(Dinner dinner)
          {
              //List&lt;RSVP&gt; rsvps = dinner.RSVPs.ToList();
  
              //foreach (RSVP rsvp in dinner.RSVPs)
              //    entities.RSVPs.DeleteObject(rsvp);
  
              entities.Dinners.DeleteObject(dinner);
          }
  
          public void Save()
          {
              entities.SaveChanges();
          }
      }
  }
  </code></pre>