示例#1
0
        public AjaxListResult GetItems(PageParentInput input)
        {
            const int PageSize = 5;
            input.Parent = (input.Parent ?? "").ToLower();

            var list = Db.Meals.Where(o => o.Name.ToLower().Contains(input.Parent));

            return new AjaxListResult
            {
                Items = list.Skip((input.Page - 1) * PageSize).Take(PageSize).Select(o => new KeyContent(o.Id, o.Name)),
                More = list.Count() > input.Page * PageSize // bool - show More button or not
            };
        }
示例#2
0
        public AjaxListResult GetItems(PageParentInput input)
        {
            const int PageSize = 5;

            input.Parent = (input.Parent ?? "").ToLower();

            var list = Db.Meals.Where(o => o.Name.ToLower().Contains(input.Parent));

            return(new AjaxListResult
            {
                Items = list.Skip((input.Page - 1) * PageSize).Take(PageSize).Select(o => new KeyContent(o.Id, o.Name)),
                More = list.Count() > input.Page * PageSize // bool - show More button or not
            });
        }