public List <P_Point> GetPoints() { if (_cachedPoints != null) { return(_cachedPoints); } return(_cachedPoints = _pointService.GetPoints()); }
public ActionResult Index(int?page) { int pageNumber = page ?? 1; int begin = pageNumber * QTD; IEnumerable <PointModel> AllPoints = service.GetPoints(begin, QTD); var onePage = AllPoints.ToPagedList(1, QTD); int totalPoints = service.GetTotalPoints(); IEnumerable <string> totalPages = Enumerable.Repeat(string.Empty, totalPoints); ViewBag.TotalPages = totalPages.ToPagedList(pageNumber, QTD); ViewBag.OnePage = onePage; return(View()); }
// GET: api/Points public IEnumerable <PointDto> GetPoints() { return(psvc.GetPoints().Select(b => PointDto.FromPoint(b))); }