Beispiel #1
0
        public async Task <ActionResult <PagedResponse <List <Measure> > > > GetMeasure([FromQuery] MeasurePaginationFilter filter)
        {
            var userId = HttpContext.User
                         .Claims
                         .Where(claim => claim.Type.Equals(ClaimTypes.NameIdentifier))
                         .First()
                         .Value;

            (var pagedData, var totalCount) = await filter.Process(_context.Measure, _context.Thing, new Guid(userId));

            var pagedReponse = PaginationHelper.CreatePagedReponse(
                await pagedData.ToListAsync(),
                filter,
                totalCount,
                _uriService,
                Request
                );

            return(Ok(pagedReponse));
        }