public IActionResult View(int id) { var model = _person.GetPersonDetails(id); if (model == null) { return(NotFound()); //Return not found (404 friendly page) if model is null } return(View(model)); }
public IActionResult Get(int id) { var detail = _service.GetPersonDetails(id); return(Ok(detail)); }