public IHttpActionResult Putligne_de_commande(int id, ligne_de_commande ligne_de_commande)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != ligne_de_commande.Qauntity)
            {
                return(BadRequest());
            }

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

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!ligne_de_commandeExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
        public IHttpActionResult Postligne_de_commande(ligne_de_commande ligne_de_commande)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.ligne_de_commande.Add(ligne_de_commande);

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateException)
            {
                if (ligne_de_commandeExists(ligne_de_commande.Qauntity))
                {
                    return(Conflict());
                }
                else
                {
                    throw;
                }
            }

            return(CreatedAtRoute("DefaultApi", new { id = ligne_de_commande.Qauntity }, ligne_de_commande));
        }
        public async Task <IHttpActionResult> Postligne_de_commande(ligne_de_commande ligne_de_commande)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.ligne_de_commande.Add(ligne_de_commande);

            try
            {
                await db.SaveChangesAsync();
            }
            catch (DbUpdateException)
            {
                if (ligne_de_commandeExists(ligne_de_commande.idCommande))
                {
                    return(Conflict());
                }
                else
                {
                    throw;
                }
            }

            return(CreatedAtRoute("DefaultApi", new { id = ligne_de_commande.idCommande }, ligne_de_commande));
        }
        public IHttpActionResult Getligne_de_commande(int id)
        {
            ligne_de_commande ligne_de_commande = db.ligne_de_commande.Find(id);

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

            return(Ok(ligne_de_commande));
        }
        public async Task <IHttpActionResult> Getligne_de_commande(int id)
        {
            ligne_de_commande ligne_de_commande = await db.ligne_de_commande.FindAsync(id);

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

            return(Ok(ligne_de_commande));
        }
        public IHttpActionResult Deleteligne_de_commande(int id)
        {
            ligne_de_commande ligne_de_commande = db.ligne_de_commande.Find(id);

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

            db.ligne_de_commande.Remove(ligne_de_commande);
            db.SaveChanges();

            return(Ok(ligne_de_commande));
        }
        public async Task <IHttpActionResult> Deleteligne_de_commande(int id)
        {
            ligne_de_commande ligne_de_commande = await db.ligne_de_commande.FindAsync(id);

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

            db.ligne_de_commande.Remove(ligne_de_commande);
            await db.SaveChangesAsync();

            return(Ok(ligne_de_commande));
        }