//Para obtener por ID public Estudiantes obtenerPorId(int id) { try { return(estudianteDal.obtenerPorID(id)); } catch (Exception ex) { throw; } }
//Para obtener por ID public Estudiantes obtenerPorId(int id) { try { using (MyDbContext context = new MyDbContext()) { //crear instancia de la DAL y se pasa el contexto de la bd EstudiantesDAL dal = new EstudiantesDAL(context); //llamada al metodo para obtener todos los registros return(dal.obtenerPorID(id)); } } catch (Exception ex) { throw; } }