Esempio n. 1
0
        public async Task ExecuteAsync(UpdateStewardressCommand command)
        {
            var stewardess = await _stewardessRepository.GetById(command.Id);

            if (stewardess == null)
            {
                throw new Exception("Stewardess with this Id does not exist");
            }

            stewardess.FirstName   = command.FirstName ?? stewardess.FirstName;
            stewardess.LastName    = command.LastName ?? stewardess.LastName;
            stewardess.DateOfBirth = command.DateOfBirth;

            await _stewardessRepository.Update(stewardess);
        }
 public void UpdateStewardess(int id, StewardessDTO item)
 {
     stewardessRepo.Update(id, Mapper.Map <StewardessDTO, Stewardess>(item));
 }