public IHttpActionResult PostProduction(Models.Production production)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.Productions.Add(production);

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateException)
            {
                if (ProductionExists(production.Production_ID))
                {
                    return(Conflict());
                }
                else
                {
                    throw;
                }
            }

            return(CreatedAtRoute("DefaultApi", new { id = production.Production_ID }, production));
        }
        public IHttpActionResult PutProduction(int id, Models.Production production)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != production.Production_ID)
            {
                return(BadRequest());
            }

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

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

            return(StatusCode(HttpStatusCode.NoContent));
        }
        public IHttpActionResult GetProduction(int id)
        {
            Models.Production production = db.Productions.Find(id);
            if (production == null)
            {
                return(NotFound());
            }

            return(Ok(production));
        }
        public IHttpActionResult DeleteProduction(int id)
        {
            Models.Production production = db.Productions.Find(id);
            if (production == null)
            {
                return(NotFound());
            }

            db.Productions.Remove(production);
            db.SaveChanges();

            return(Ok(production));
        }