1
When I try to update an object in the database, I get the error,
Store update, Insert, or delete statement affected an Unexpected number of Rows (0). Entities may have been modified or Deleted Since entities Were Loaded. See http://go.microsoft.com/fwlink/? Linkid=472540 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 update, insert or delete instruction affected a unexpected number of lines (0). 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 undergone changes through the debug
I just don’t understand why EPH can’t detect them.
Welcome to Stack Overflow! Use this language as default on this site.
– Daniel Ikenaga