public IHttpActionResult GetpositionsPaging(int pageSize, int pageNumber) { ResponseDataDTO <PagedResults <position> > response = new ResponseDataDTO <PagedResults <position> >(); try { response.Code = HttpCode.OK; response.Message = MessageResponse.SUCCESS; response.Data = _positionservice.CreatePagedResults(pageNumber, pageSize); } catch (Exception ex) { response.Code = HttpCode.INTERNAL_SERVER_ERROR; response.Message = ex.Message; response.Data = null; Console.WriteLine(ex.ToString()); } return(Ok(response)); }