Estou usando o Entity framework para fazer o CRUD no banco de dados, mas tenho um erro ao tentar deletar algum item: "The object cannot be deleted because it was not found in the ObjectStateManager.".
"The object cannot be deleted because it was not found in the
ObjectStateManager."
Mas ai retorna o erro: "Attaching an entity of type 'V1.Dominio.Entidades.Usuario' failed because another entity of the same type already has the same primary key value. This can happen when using the 'Attach' method or setting the state of an entity to 'Unchanged' or 'Modified' if any entities in the graph have conflicting key values. This may be because some entities are new and have not yet received database-generated key values. In this case use the 'Add' method or the 'Added' entity state to track the graph and then set the state of non-new entities to 'Unchanged' or 'Modified' as appropriate."
"Attaching an entity of type 'V1.Dominio.Entidades.Usuario' failed
because another entity of the same type already has the same primary
key value. This can happen when using the 'Attach' method or setting
the state of an entity to 'Unchanged' or 'Modified' if any entities in
the graph have conflicting key values. This may be because some
entities are new and have not yet received database-generated key
values. In this case use the 'Add' method or the 'Added' entity state
to track the graph and then set the state of non-new entities to
'Unchanged' or 'Modified' as appropriate."