示例#1
0
        public HttpResponseMessage GetFlightByid(int id)
        {
            using (TECAirlinesDBEntities entities = new TECAirlinesDBEntities())
            {
                var ent = entities.SELECT_FLIGHT_ID(id).ToList();

                if (ent != null)
                {
                    return(Request.CreateResponse(HttpStatusCode.OK, ent));
                }
                else
                {
                    return(Request.CreateErrorResponse(HttpStatusCode.NotFound,
                                                       "EL vuelo con identificación " + id + "no existe."));
                }
            }
        }