码迷,mamicode.com
首页 > 其他好文 > 详细

EF查询

时间:2015-06-10 18:49:07      阅读:126      评论:0      收藏:0      [点我收藏+]

标签:

 public ActionResult AllSettings(DataSourceRequest command,
            Framework.Kendoui.Filter filter = null, Sort sort = null)
        {
            var settings = this._settingService.GetAllSettings().Select(x => new SettingModel
                                {
                                    Id = x.Id,
                                    Name = x.Name,
                                    Value = x.Value
                                }).AsQueryable()
                .Filter(filter)
                .Sort(sort);
            int total = settings.Count();


            var totalPages = total / command.PageSize;
            if (total % command.PageSize > 0)
                totalPages++;

            var gridModel = new DataSourceResult
            {
                Data = settings.PagedForCommand(command).ToList(),
                TotalRecords = total,
                TotalPages = totalPages

            };
            return Json(gridModel);
        }

 

EF查询

标签:

原文地址:http://www.cnblogs.com/honghong75042/p/4566807.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!