When I try to update an object in the database, I get the error,
Store update, insert, or delete statement number of rows (0). Entities may have been modified or deleted since groups were loaded. See link for information on understanding and handling optimistic concurrency exceptions.
In this code:
[HttpPost]
public async Task<ActionResult> Editar(Cliente cliente)
{
if (cliente.Titulo != null)
{
db.Entry(cliente.Titulo).State = EntityState.Modified;
db.SaveChanges();
}
}
A translation for the error, is:
Store upgrade, insertion, or deletion statement affected a unexpected number of rows (0). The entities may have been modified, or deleted since entities were loaded.
I want to know, what does this error mean and why is it occurring in my code? I made sure that the object has been changed by debug
I just do not understand why EF is not able to detect them.