예제 #1
0
        public async Task <IActionResult> Details(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            var department = await _webApiService.FindByIdAsync <Department>(id.Value);

            if (department == null)
            {
                return(NotFound());
            }

            return(View(department));
        }
예제 #2
0
        public async Task <IActionResult> Delete(int?id)
        {
            if (id == null)
            {
                return(RedirectToAction(nameof(Error), new { message = "Id not provided." }));
            }

            var seller = await _webApiService.FindByIdAsync <Seller>(id.Value);

            if (seller == null)
            {
                return(RedirectToAction(nameof(Error), new { message = "Id not found." }));
            }

            return(View(seller));
        }