I am getting this error \"The object cannot be deleted because it was not found in the ObjectStateManager.\"
My code is:
protected MyEntities sql
You should be sure that your object is exist in the list you are trying to remove from , you should put the following condition
if(context.entity.contains(your object))
remove it.
if you have a complicated condition for equality you should override equal method in entity class to put your condition for equality , to get the right way for an extension method "entity.contains"