public async Task <ChangeTypeSliderToDiscountCommandResponse> Handle(ChangeTypeSliderToDiscountCommand command) { var slider = await _repository.AsQuery().SingleOrDefaultAsync(p => p.ImageName == command.ImageName); if (slider == null) { throw new DomainException(" اسلایدر یافت نشد"); } slider.SliderType = command.SliderType; return(new ChangeTypeSliderToDiscountCommandResponse()); }
public async Task <IHttpActionResult> Put(ChangeTypeSliderToDiscountCommand command) { var response = await Bus.Send <ChangeTypeSliderToDiscountCommand, ChangeTypeSliderToDiscountCommandResponse>(command); return(Ok(response)); }