public void Update(EditUserInputDto userInput) { Guard.ArgumentNotNull(() => userInput); Guard.ArgumentNotEmpty(() => userInput.Id); var toUpdate = this.userRepository.GetByKey(userInput.Id); toUpdate = Mapper.Map<EditUserInputDto, User>(userInput, toUpdate); this.userRepository.Update(toUpdate); this.userRepository.Context.Commit(); }