public async Task <IHttpActionResult> Put(DeActiveCategoryCommand command) { var response = await Bus.Send <DeActiveCategoryCommand, DeActiveCategoryCommandResponse>(command); return(Ok(response)); }
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())); }