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()); }
public async Task <Unit> Handle(RemoverEstabelecimentoDaCipaCommand request, CancellationToken cancellationToken) { request.Cipa.RemoverEstabelecimento(request.EstabelecimentoId); return(await ProcederComAAtualizacaoDaCipaAsync(request.Cipa)); }