Exemplo n.º 1
0
        public async Task <PromoterCommandResponse> Handle(UpdatePromoterCommand command)
        {
            var promoter = await _repository.FindAsync(command.Id);

            if (promoter == null)
            {
                throw new DomainException("شخص یافت نشد");
            }
            await _promoterDomainService.CheckPromoterIsExistForUpdate(promoter.Id, command.NationalCode);

            promoter.NationalCode = command.NationalCode;
            promoter.LastName     = command.LastName;
            promoter.FirstName    = command.FirstName;
            promoter.MobileNumber = command.MobileNumber;
            return(new PromoterCommandResponse());
        }
Exemplo n.º 2
0
        public async Task <IHttpActionResult> Put(UpdatePromoterCommand command)
        {
            var response = await Bus.Send <UpdatePromoterCommand, PromoterCommandResponse>(command);

            return(Ok(response));
        }