public ActionResult <ItemResponse <Paged <Venue> > > PaginationV2(int pageIndex, int pageSize) { int code = 200; BaseResponse response = null; try { Paged <Venue> paged = _service.PaginateV2(pageIndex, pageSize); if (paged == null) { code = 404; response = new ErrorResponse("Venue Record Not Found"); } else { response = new ItemResponse <Paged <Venue> > { Item = paged }; } } catch (Exception ex) { code = 500; response = new ErrorResponse(ex.Message); base.Logger.LogError(ex.ToString()); } return(StatusCode(code, response)); }