Exemple #1
0
        public IActionResult GetById(long id)
        {
            var todoItem = _todoService.GetById(id);

            if (todoItem == null)
            {
                return(NotFound());
            }
            return(new ObjectResult(todoItem));
        }
Exemple #2
0
        public IActionResult GetById(long id)
        {
            var item = _service.GetById(id);

            if (item == null)
            {
                return(NotFound());
            }
            return(new ObjectResult(item));
        }
        public IActionResult GetById(long id)
        {
            var item = _service.GetById(id);

            if (item == null)
            {
                return(NotFound());
            }
            ViewData["item"] = item;
            return(View());
        }