Example #1
0
        public async Task <IActionResult> GetById(int id)
        {
            var item = await _stuffService.GetByIdAsync(id);

            if (item == null)
            {
                return(NotFound());
            }
            return(new ObjectResult(item));
        }
Example #2
0
 public async Task ThrowsInvalidStuffId()
 {
     //var result = await _service.GetByIdAsync(1);
     await Assert.ThrowsAsync <System.ArgumentNullException>(async() =>
                                                             await _service.GetByIdAsync(-1));
 }