public async Task <Unit> Handle(RemoverAssuntoDaAtaDeReuniaoCommand request, CancellationToken cancellationToken) { if (request.Reuniao.Ata == null) { throw new AtaDeReuniaoAindaNaoGeradaException(); } if (request.Reuniao.Ata.Id != request.AtaId) { throw new AtaDeReuniaoInvalidaException(); } request.Reuniao.Ata.RemoverAssunto(request.AssuntoId); return(await ProcederComAAtualizacaoDaReuniaoAsync(request.Reuniao)); }
public async Task <IActionResult> AssuntosAtasDeleteAsync(Guid id, Guid ataId, Guid assuntoId) { var reuniao = await ObterReuniaoAsync(id); var command = new RemoverAssuntoDaAtaDeReuniaoCommand() { Reuniao = reuniao, AtaId = ataId, AssuntoId = assuntoId }; await mediator.Send(command); return(NoContent()); }