示例#1
0
        // GET: Admin/Dashboard/Consultancy
        public ActionResult Consultancy(int?page)
        {
            //var students = from s in _dbContext.tbl_consultancy select s;

            var consultancyVar = _consultancyRepository.GetAll();

            //return View(_dbContext.tbl_consultancy.ToList()); // This function directly called from the database located from the "context" folder
            //return View(_consultancyRepository.GetAll()); // This function called from the "Repository" folder which is dependency injection of Unity in App_Start which is also registered in Global.asax

            int pageSize   = 2;
            int pageNumber = (page ?? 1);

            return(View(consultancyVar.ToPagedList(pageNumber, pageSize)));
        }
示例#2
0
 // GET: Admin/Dashboard/Consultancy
 public ActionResult Consultancy()
 {
     //return View(_dbContext.tbl_consultancy.ToList()); // This function directly called from the database located from the "context" folder
     return(View(_consultancyRepository.GetAll())); // This function called from the "Repository" folder which is dependency injection of Unity in App_Start which is also registered in Global.asax
 }