コード例 #1
0
        public async Task <IHttpActionResult> Put(DeActiveCategoryCommand command)
        {
            var response = await
                           Bus.Send <DeActiveCategoryCommand, DeActiveCategoryCommandResponse>(command);

            return(Ok(response));
        }
コード例 #2
0
        public Task <DeActiveCategoryCommandResponse> Handle(DeActiveCategoryCommand command)
        {
            var category = _repository.Find(command.Id);

            if (category == null)
            {
                throw new DomainException("دسته بندی یافت نشد");
            }
            category.DeActive();
            return(Task.FromResult(new DeActiveCategoryCommandResponse()));
        }