public void Execute(UpdateClientAddress command)
        {
            IRepository <Client> clientRepository = unitOfWork.GetRepository <Client>();
            Client client = clientRepository.Get(command.ClientId);

            client.UpdateAddress(command.StreetNumber, command.Street, command.City, command.PostalCode);
            unitOfWork.Commit();

            Logger.Info("Updated client address.");
        }
예제 #2
0
        public void Execute(UpdateClientAddress command)
        {
            IRepository <Client> clientRepository = unitOfWork.GetRepository <Client>();
            Client client = clientRepository.Get(command.ClientId);

            try
            {
                client.UpdateAddress(command.StreetNumber, command.Street, command.City, command.PostalCode);
                unitOfWork.Commit();

                logger.Verbose("Updated client address.");
            }
            catch
            {
                unitOfWork.Rollback();
                throw;
            }
        }