Beispiel #1
0
        public SocViewModel GetAllSocials(int pageid = 1, string Filter = "")
        {
            IQueryable <Social> result = db.Socials;

            if (!string.IsNullOrEmpty(Filter))
            {
                result = db.Socials.Where(t => t.SocialName.Contains(Filter));
            }

            var          take = 20;
            var          skip = (pageid - 1) * take;
            SocViewModel list = new SocViewModel();

            list.CurrentPage = pageid;
            list.pagaCount   = result.Count() / take;
            list.Socials     = result.OrderBy(t => t.SociaId).Skip(skip).Take(take)
                               .ToList();
            return(list);
        }
Beispiel #2
0
 public void OnGet(int id, int pageid = 1, string filter = "")
 {
     SocViewModel = _adminService.GetAllSocials(pageid, filter);
 }