예제 #1
0
        public async Task <IActionResult> EstabelecimentosDeleteAsync(Guid id,
                                                                      Guid estabelecimentoId)
        {
            var cipa = await ObterCipaAsync(id);

            var command = new RemoverEstabelecimentoDaCipaCommand()
            {
                Cipa = cipa,
                EstabelecimentoId = estabelecimentoId
            };

            await mediator.Send(command);

            return(NoContent());
        }
예제 #2
0
        public async Task <Unit> Handle(RemoverEstabelecimentoDaCipaCommand request, CancellationToken cancellationToken)
        {
            request.Cipa.RemoverEstabelecimento(request.EstabelecimentoId);

            return(await ProcederComAAtualizacaoDaCipaAsync(request.Cipa));
        }