public IComandResult Handle(AlterarEscolaCommands comand) { //verificar se tem notificação no comand if (!comand.IsValid()) { return(new ComandResult(false, "Por favor corrija os campos abaixo", comand.Notifications)); } var escola = _repository.Existe(comand.Id); if (escola != null) { escola.Alterar(comand.Nome); _repository.Alterar(escola); } else { return(new ComandResult(false, "Série não existe,tente novamente!!", new { })); } return(new ComandResult(true, "Dados Alterados com Sucesso!!", new { })); }