Пример #1
0
        public async Task <Unit> Handle(RemoverParticipanteDaAtaDeReuniaoCommand request, CancellationToken cancellationToken)
        {
            if (request.Reuniao.Ata == null)
            {
                throw new AtaDeReuniaoAindaNaoGeradaException();
            }

            if (request.Reuniao.Ata.Id != request.AtaId)
            {
                throw new AtaDeReuniaoInvalidaException();
            }

            request.Reuniao.Ata.RemoverParticipante(request.ParticipanteId);

            return(await ProcederComAAtualizacaoDaReuniaoAsync(request.Reuniao));
        }
        public async Task <IActionResult> ParticipantesAtasDeleteAsync(Guid id,
                                                                       Guid ataId,
                                                                       Guid participanteId)
        {
            var reuniao = await ObterReuniaoAsync(id);

            var command = new RemoverParticipanteDaAtaDeReuniaoCommand()
            {
                Reuniao        = reuniao,
                AtaId          = ataId,
                ParticipanteId = participanteId
            };

            await mediator.Send(command);

            return(NoContent());
        }