Exemplo n.º 1
0
        public static void Deletar(LinhaDeBase linhaDeBase)
        {
            List <Experimento> experimentos = ExperimentoService.GetByLinhaDeBase(linhaDeBase);

            if (experimentos.Count > 0)
            {
                throw new Exception("A linha de base não pode ser deletada! Está sendo usada nos seguintes esperimentos: " + string.Join(", ", experimentos.Select(it => it.Nome)));
            }

            AbstractService.Deletar(linhaDeBase, TABELA_LinhaDeBase);
        }