ef core detach entity code example Example: ef core detach entity _context.Entry(entityToUntrack).State = EntityState.Detach