/// <summary>
        /// Updates an existing Fuel Delivery Event record.
        /// </summary>
        /// <param name="pkey"></param>
        /// <param name="fuel_Delivery_Event"></param>
        public HttpResponseMessage Put(int pkey, [FromBody] fuel_delivery_event fuel_Delivery_Event)
        {
            try
            {
                using (efc_testEntities1 entities = new efc_testEntities1())
                {
                    var entity = entities.fuel_delivery_event.FirstOrDefault(e => e.pkey == pkey);

                    if (entity == null)
                    {
                        return(Request.CreateErrorResponse(HttpStatusCode.NotFound, "A record with pkey " + pkey.ToString() + " was not found."));
                    }
                    else
                    {
                        entity.current_stop       = fuel_Delivery_Event.current_stop;
                        entity.next_stop          = fuel_Delivery_Event.next_stop;
                        entity.current_fuel_level = fuel_Delivery_Event.current_fuel_level;

                        entities.SaveChanges();
                        return(Request.CreateResponse(HttpStatusCode.OK, entity));
                    }
                }
            }
            catch (Exception ex)
            {
                return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, ex));
            }
        }
        /// <summary>
        /// Posts a new Fuel Delivery Event Record
        /// </summary>
        /// <param name="fuel_Delivery_Event"></param>
        /// <returns></returns>
        public HttpResponseMessage Post([FromBody] fuel_delivery_event fuel_Delivery_Event)
        {
            try
            {
                using (efc_testEntities1 entities = new efc_testEntities1())
                {
                    entities.fuel_delivery_event.Add(fuel_Delivery_Event);
                    entities.SaveChanges();

                    var message = Request.CreateResponse(HttpStatusCode.Created, fuel_Delivery_Event);
                    message.Headers.Location = new Uri(Request.RequestUri + fuel_Delivery_Event.pkey.ToString());
                    return(message);
                }
            }
            catch (Exception ex)
            {
                return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, ex));
            }
        }