I have this code which works in EntityFrameworkCore.
public void SaveProject(Project item) { var existing = _context.Projects.FirstOrDefault(a =&
If you are certain that item exist in database, you can use Attach method of DbContext As following
public void SaveProject(Project item) { _context.Projects.Attach(item); _context.Entity(item).State=EntityState.Modified; _context.SaveChanges(); }