public async Task <IHttpActionResult> PutNomFlightForms(int id, NomFlightForms nomFlightForms)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != nomFlightForms.Id)
            {
                return(BadRequest());
            }

            db.Entry(nomFlightForms).State = EntityState.Modified;

            try
            {
                await db.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!NomFlightFormsExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
        public async Task <IHttpActionResult> GetNomFlightForms(int id)
        {
            NomFlightForms nomFlightForms = await db.NomFlightForms.FindAsync(id);

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

            return(Ok(nomFlightForms));
        }
        public async Task <IHttpActionResult> PostNomFlightForms(NomFlightForms nomFlightForms)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.NomFlightForms.Add(nomFlightForms);
            await db.SaveChangesAsync();

            return(CreatedAtRoute("DefaultApi", new { id = nomFlightForms.Id }, nomFlightForms));
        }
        public async Task <IHttpActionResult> DeleteNomFlightForms(int id)
        {
            NomFlightForms nomFlightForms = await db.NomFlightForms.FindAsync(id);

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

            db.NomFlightForms.Remove(nomFlightForms);
            await db.SaveChangesAsync();

            return(Ok(nomFlightForms));
        }