title: Simple LINQ query to Delete From DataContext Where ID == ID
body: <p>I am getting the ID of an entry in a database table in my codebehind, and am trying to find a simple LINQ query to delete the entry based on the ID.</p>
  
  <p>Here is what I have:</p>
  
  <pre><code>DataContext.Items.DeleteObject((Item)DataContext.Items.Where(item =&gt; item.ItemId == selectedId));
  </code></pre>
  
  <p>This gives me a casting error however, and I am wondering if there is a better way to accomplish this? I've looked at similar questions and every answer I see seems to be more complicated than this should actually be, so any suggestions would be great!</p>