public async Task <CommandResult> Handle(ExcluirSalaCommand command, CancellationToken cancellationToken) { if (command.Id == Guid.Empty) { return(new CommandResult(false, "Informe o Id da sala")); } if (!_salaRepository.Existe(command.Id)) { return(new CommandResult(false, "Sala não encontrada")); } _salaRepository.Excluir(command.Id); return(await Task.FromResult(new CommandResult(true, "Sala excluida com sucesso"))); }