Exemplo n.º 1
0
        public IHttpActionResult Get()
        {
            // hit the database just so the objects do not get garbage collected
            PersonBLL bll = new PersonBLL();

            bll.Get(1);

            return(Content(HttpStatusCode.OK, "Staying Alive!"));
        }
Exemplo n.º 2
0
        public IHttpActionResult Get(int id)
        {
            PersonBLL bll    = new PersonBLL();
            var       person = bll.Get(id);

            if (person == null)
            {
                return(Content(HttpStatusCode.NotFound, "Person does not exist."));
            }
            else
            {
                return(Ok(person));
            }
        }