public async Task <IActionResult> GetList() { Demand entity = new Demand(); PageParam pageParam = new PageParam(); pageParam.Params.Add(new QueryParam("ClientFile.ClientName", "托田", LogicEnum.Like)); pageParam.Params.Add(new QueryParam("ClientFile.ClientName", "托田1", LogicEnum.NoLike)); pageParam.Params.Add(new QueryParam("ClientFile.ClientName", "营口", LogicEnum.LikeRight)); pageParam.Params.Add(new QueryParam("ClientFile.ClientName", "公司", LogicEnum.LikeLeft)); pageParam.Params.Add(new QueryParam("AutoID", "100", LogicEnum.GreaterThan)); pageParam.Params.Add(new QueryParam("InputDate", "2010-01-01", LogicEnum.GreaterThanOrEqual)); pageParam.Params.Add(new QueryParam("AutoID", "10000000.0", LogicEnum.LessThan)); pageParam.Params.Add(new QueryParam("AdditionalPoints", "10000.0", LogicEnum.LessThanOrEqual)); pageParam.Params.Add(new QueryParam("AdditionalPoints", "100.0", LogicEnum.NoEqual)); IEnumerable <Demand> data = await demandService.GetPageAsync(pageParam); ApiTableResult <DemandView> res = new ApiTableResult <DemandView>(); data.ToDtoList <Demand, DemandView>(); res.Data = this.mapper.Map <List <DemandView> >(data); return(Ok(res)); }
public async Task <ApiResult> GetListAsync(Expression <Func <Demand, bool> > where) { var query = fsql.Select <Demand>().LeftJoin(a => a.ClientFile.ID == a.ClientName).Page(1, 20); var list = await query.ToListAsync(); ApiResult res = new ApiTableResult <Demand>(list); return(res); }