Exemple #1
0
        public HttpResponseMessage Get(string id)
        {
            var traveler = travelers.FindBy(t => t.TravelerUserIdentity == id).FirstOrDefault();

            // Handling the HTTP status codes
            if (traveler != null)
            {
                return(Request.CreateResponse <Traveler>(HttpStatusCode.OK, traveler));
            }
            else
            {
                return(Request.CreateResponse(HttpStatusCode.NotFound));
            }
        }