title: Exception Handling in C# with Entity Framwork 4
body: <p>I use asp.net 4, c# and ef4.</p>
  
  <p>I would like to know what is the best way to <strong>catch an generic Exception from Entity Framework.</strong></p>
  
  <ul>
  <li>At the moment I use <code>Exception</code> it is appropriate?</li>
  <li>How catch a more specific one?</li>
  </ul>
  
  <p>Thanks for your time.</p>
  
  <pre><code>try
  {
      context.DeleteObject(myLockedContent);
      context.SaveChanges();
  }
  catch (Exception)
  {
      e.Cancel = true;
  }
  </code></pre>