Exemplo n.º 1
0
        public async Task <IHttpActionResult> Put(ActiveBrandCommand command)
        {
            var response = await
                           Bus.Send <ActiveBrandCommand, ActiveBrandCommandResponse>(command);

            return(Ok(response));
        }
Exemplo n.º 2
0
        public Task <ActiveBrandCommandResponse> Handle(ActiveBrandCommand command)
        {
            var brand = _repository.Find(command.Id);

            if (brand == null)
            {
                throw new DomainException("برند یافت نشد");
            }
            brand.Active();
            return(Task.FromResult(new ActiveBrandCommandResponse()));
        }