Api 存储过程分页

 //分页
        [Route("api/pager")]
        [HttpGet]
        public IHttpActionResult Pager(int PageSize, int PageIndex)
        {
            IDbConnection db = AbsContention.SqlGet();
            var param = new DynamicParameters();
            param.Add("@TabeName", "LogType");
            param.Add("@FileName", "*");
            param.Add("@Orderby", "ID");
            param.Add("@where", "");
            param.Add("@PageSize", PageSize);
            param.Add("@PageIndex", PageIndex);
            int total = 0;
            param.Add("@TableCount", 0, DbType.Int32, ParameterDirection.Output);
            //  db.Query<List<StudentModels>>("Proc_Pager",)
            var res2 = db.Query<LogModel>("FenYe", param, null, true, null, CommandType.StoredProcedure).ToList();//res2.Count = 80
            total = param.Get<int>("@TableCount");  //Execute count = 80
            return Ok(new { data = res2, total = total });
        }

上一篇:全局变量位于elf文件中的哪个位置


下一篇:linux – 强制GNU链接器生成32位ELF可执行文件