title: The object cannot be deleted because it was not found in the ObjectStateManager
body: <p>I am getting this error "The object cannot be deleted because it was not found in the ObjectStateManager."</p>
  
  <p>My code is:</p>
  
  <pre><code>    protected MyEntities sqlEntities;
  
      public virtual void Delete(TEntity entity)
      {
          System.Type t = typeof(TEntity);
          sqlEntities.DeleteObject(entity);
          sqlEntities.SaveChanges();
      }
  </code></pre>