public async Task <IHttpActionResult> Put(ActiveCategoryCommand command) { var response = await Bus.Send <ActiveCategoryCommand, ActiveCategoryCommandResponse>(command); return(Ok(response)); }
public Task <ActiveCategoryCommandResponse> Handle(ActiveCategoryCommand command) { var category = _repository.Find(command.Id); if (category == null) { throw new DomainException("دسته بندی یافت نشد"); } category.Active(); return(Task.FromResult(new ActiveCategoryCommandResponse())); }