コード例 #1
0
        bool IRepositorio.ExcluirAluno(int idAluno)
        {
            try
            {
                Aluno aluno = ObterAlunoPorId(idAluno);

                if (aluno == null)
                {
                    return(false);
                }

                _db.Remove(aluno);
                _db.SaveChanges();
                return(true);
            }
            catch
            {
                return(false);
            }
        }