I was getting following errorSystem.InvalidOperationException: The object cannot be deleted because it was not found in the ObjectStateManager.
while trying to delete an object from Entity framework.Solution
The solution of this problem is to find the object using .where clause and then delete it.
var db = db.Users.Where(u => u.UserName.Equals("myusername")).FirstOrDefault();
Hope this helps.