示例#1
0
        // GET: People/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Person person = repo.FindPersonById(id);

            if (person == null)
            {
                return(HttpNotFound());
            }
            return(View(person));
        }
示例#2
0
        public IHttpActionResult GetPerson(int id)
        {
            Person person = _repo.FindPersonById(id);

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

            return(Ok(person));
        }