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."); }
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; } }