Example #1
0
        public PagedResults <Stuff> GetStuff(string search = "", int page = 1, int pageSize = 12)
        {
            var stuff = _stuffRepository.Get();

            stuff = SearchStuff(stuff, search);

            var paged = CollectionUtils.PageResults(stuff, page, pageSize);

            paged.Results = SortChildren(paged.Results);

            return(paged);
        }
Example #2
0
        public async Task <IActionResult> GetById(int id)
        {
            var item = await _stuffService.Get(id.ToString());

            if (item == null)
            {
                return(NotFound());
            }
            return(new ObjectResult(item));
        }
 // GET api/<controller>/5
 public string Get(string key)
 {
     return(_personRepo.Get(key)?.Value.ToString());
 }
Example #4
0
        public async Task ThrowsInvalidStuffId()
        {
            var result = await _service.Get("-1");

            Assert.Null(result);
        }