public IPageCollection <Model.RuleRegulationPage> GetRuleRegulationList(int page, int limit, Model.RuleRegulationSearch search) { var query = from a in _dbContext.RuleRegulation join b in _dbContext.RuleRegulationType on a.TypeId equals b.Id orderby a.Id descending where (string.IsNullOrEmpty(search.Title)?true:a.Title.Contains(search.Title)) && (search.TypeId == -1 ? true: search.TypeId == a.TypeId) select new Model.RuleRegulationPage { Id = a.Id, TypeId = a.TypeId, TypeName = b.RuleName, Title = a.Title, PublisherId = a.PublisherId, CreateDate = a.CreateDate, Content = a.Content, EnclosureUrl = a.EnclosureUrl }; return(query.Page(page, limit)); }
public IPageCollection <Model.RuleRegulationPage> GetRuleRegulationList(int page, int limit, Model.RuleRegulationSearch search) { return(_repository.GetRuleRegulationList(page, limit, search)); }
public IPageCollection <Model.RuleRegulationPage> GetRuleRegulationPage([FromForm] int page, [Range(1, 50)][FromForm] int limit, [FromForm] Model.RuleRegulationSearch search) { var pageList = _ruleRegulationBusiness.GetRuleRegulationList(page, limit, search); return(pageList); }