public IDataResult <List <Context> > GetByCourseId(int id)
        {
            List <Context> result;

            result = _contextDal.GetAll(c => c.CourseId == id);
            try
            {
                result = _contextDal.GetAll(c => c.CourseId == id);
            }
            catch (Exception)
            {
                return(new ErrorDataResult <List <Context> >("Cannot get course contents"));
            }
            return(new SuccessDataResult <List <Context> >(result));
        }
Example #2
0
 public IDataResult <List <Context> > GetAll()
 {
     return(new SuccessDataResult <List <Context> >(_contextDal.GetAll()));
 }