title: Entity Framework composite key delete with one primary key
body: <p>Here's some of my database design on my assignments</p>
  
  <pre><code>Customer
  --------
  CustomerID (PK)
  
  Cake
  -------
  CakeID (PK)
  
  Cart
  -------
  CustomerID (PK, FK)
  CakeID (PK, FK)
  </code></pre>
  
  <p>I'd like to make a function <code>clearUserCart(User user)</code> in my Cart Repository class but I have no idea how to make function to delete all rows with specified user.</p>
  
  <p><strong>EDIT :</strong>
  I have figured out how to do it, just use <code>getCartOfUser(User user)</code> which returns <code>List&lt;Cart&gt;</code>. Then do foreach loop to remove.
  In SQL, it could be achieved just by one line <code>DELETE FROM Cart WHERE CustomerID = &lt;the cust id&gt;</code>, is there an equivalent one line statement in entity framework?</p>