コード例 #1
0
        public async Task <SortOrderSliderCommandResponse> Handle(SortOrderSliderCommand command)
        {
            foreach (var sliderSortItem in command.Sliders)
            {
                var slider = await _repository.FindAsync(sliderSortItem.Id);

                if (slider == null)
                {
                    throw new DomainException("اسلایدر یافت نشد");
                }
                slider.Order = sliderSortItem.Order;
            }
            return(new SortOrderSliderCommandResponse());
        }
コード例 #2
0
        public async Task <IHttpActionResult> PutSort(SortOrderSliderCommand command)
        {
            var response = await Bus.Send <SortOrderSliderCommand, SortOrderSliderCommandResponse>(command);

            return(Ok(response));
        }