public void Can_Get_Filtered_Paging_List()
        {
            var request = new LPCReportRequest
            {
                PageSize = 20,
                Page     = 1,
                Borough  = "Manhattan"
            };

            var results = _lpcReportService.GetLPCReports(request).Results;

            Assert.Equal(request.PageSize, results.Count);
        }
Ejemplo n.º 2
0
        public IEnumerable <LPCReportModel> Get([FromQuery] LPCReportRequestModel query, int limit, int page)
        {
            long totalRecords = 0;
            var  request      = new LPCReportRequest
            {
                PageSize        = limit,
                Page            = page,
                SortColumn      = !string.IsNullOrEmpty(query.Sort) ? query.Sort : "name",
                SortOrder       = !string.IsNullOrEmpty(query.Order) ? query.Order : "asc",
                ParentStyleList = !string.IsNullOrEmpty(query.ParentStyles) ? query.ParentStyles.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries).ToList() : null,
                Borough         = query.Borough,
                ObjectType      = query.ObjectType
            };

            var records = _lpcReportService.GetLPCReports(request);

            totalRecords = records.Total;
            HttpContext.Response.Headers.Add("X-InlineCount", totalRecords.ToString());
            return(records.Results);
        }