public void ConfirmUser(int key) { var currentKey = _keysRepository.GetKey(key); CheckKey(currentKey, KeyAppointment.ConfirmEmail); currentKey.UseKey(); _userRepository.GetUserByEmail(currentKey.UserEmail).Type = UserType.User; _keysRepository.UpdateKey(currentKey); }