/// <summary> /// 查询数据(分页) 返回指定实体T /// </summary> ///<typeparam name="T">返回实体类型</typeparam> /// <param name="page">页码</param> /// <param name="size">每页数量</param> /// <param name="condition">查询条件类</param> /// <param name="field">返回字段</param> /// <param name="orderBy">排序字段</param> /// <returns></returns> public async Task <QueryPagedResponseModel <T> > GetListPagedAsync <T>(int page, int size, BaseDemoCondition condition, string field = null, string orderBy = null) where T : class, new() { return(await repository.GetListPagedAsync <T>(page, size, condition, field, orderBy).ConfigureAwait(false)); }
public async Task <ActionResult> GetListPagedAsync(int page = 1, int limit = 10, [FromQuery] BaseDemoCondition condition = null) { var queryPagedResponse = await queryDemoService.GetListPagedAsync <DemoEntity>(page, limit, condition, null, "id desc").ConfigureAwait(false); return(Ok(queryPagedResponse)); }