Example #1
0
        public KartResponse Get(KartResourceParameters kartSpecification)
        {
            var matchingKarts = from k in _fakeKarts
                                where k.Equals(kartSpecification)
                                select k;

            int results = Math.Min(matchingKarts.Count(), kartSpecification.Size);

            return(new KartResponse
            {
                Size = results,
                Start = kartSpecification.Start,
                TotalHits = matchingKarts.Count(),
                Hits = matchingKarts.Skip(kartSpecification.Start).Take(results).ToList()
            });
        }
Example #2
0
 public IActionResult Get([FromQuery] KartResourceParameters kartSpecification)
 {
     return(Ok(_kartService.Get(kartSpecification)));
 }