예제 #1
0
        public async Task <ActionResult <GetAllViewModel> > List([Range(1, int.MaxValue)] int page = 1)
        {
            try
            {
                var items = await _exampleService.GetList(page);

                return(Ok(new GetAllViewModel()
                {
                    ExampleEntities = items.ToList()
                }));
            }
            catch (Exception)
            {
                return(StatusCode(500, ErrorViewModel.UNHANDLED_EXCEPTION));
            }
        }
예제 #2
0
        public async Task ExampleTest_GetListPage1_IsNotNull()
        {
            var result = await _exampleService.GetList(1);

            Assert.IsNotNull(result, "ExampleService.GetList(1) returned null.");
        }