public ActionResult Delete(int id, string confirmButton) { var album = storeDB.Albums .Include("OrderDetails").Include("Carts") .Single(a => a.AlbumId == id); // For simplicity, we're allowing deleting of albums // with existing orders We've set up OnDelete = Cascade // on the Album->OrderDetails and Album->Carts relationships storeDB.DeleteObject(album); storeDB.SaveChanges(); return(View("Deleted")); }