Ejemplo n.º 1
0
 public async Task <IActionResult> GetAllPagination()
 {
     try
     {
         authHelper.IsLogin(ref CurrentLogin, ref response, HttpContext.User.Identity as ClaimsIdentity);
         if (response.IsSuccess)
         {
             string search   = HttpContext.Request.Query["search[value]"].ToString();
             int    draw     = Convert.ToInt32(HttpContext.Request.Query["draw"]);
             string order    = HttpContext.Request.Query["order[0][column]"];
             string orderDir = HttpContext.Request.Query["order[0][dir]"];
             int    startRec = Convert.ToInt32(HttpContext.Request.Query["start"]);
             int    pageSize = Convert.ToInt32(HttpContext.Request.Query["length"]);
             return(Ok(await facade.GetAllPagination(search, draw, order, orderDir, startRec, pageSize)));
         }
         return(Ok(response));
     }
     catch (Exception ex)
     {
         return(BadRequest(ex));
     }
 }
Ejemplo n.º 2
0
        public void GetAllPagination()
        {
            var isValid = facade.GetAllPagination("", 1, "1", "asc", 0, 10);

            Assert.Equal(true, isValid.Result.IsSuccess);
        }