public void MudarNome(Regra regra, string novoNome) { regra = ObterPorNome(regra.Nome); regra.MudarNome(novoNome); regra.Validar(); _regraRepository.Atualizar(regra); }
public void Registrar(Regra regra) { var hasRole = _regraRepository.Obter(regra.Nome); if (hasRole != null) throw new Exception(Errors.DuplicateRole); regra.Validar(); _regraRepository.Criar(regra); }