public Task <DeActiveProductCommandResponse> Handle(DeActiveProductCommand command) { var product = _repository.Find(command.Id); if (product == null) { throw new DomainException("محصول یافت نشد"); } product.DeActive(); _context.SaveChanges(); return(Task.FromResult(new DeActiveProductCommandResponse())); }
public async Task <IHttpActionResult> Put(DeActiveProductCommand command) { var response = await Bus.Send <DeActiveProductCommand, DeActiveProductCommandResponse>(command); return(Ok(response)); }