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

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

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

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

            return(StatusCode(HttpStatusCode.NoContent));
        }
        public IHttpActionResult GetperItemDetail(int id)
        {
            perItemDetail perItemDetail = db.perItemDetails.Find(id);

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

            return(Ok(perItemDetail));
        }
        public IHttpActionResult PostperItemDetail(perItemDetail perItemDetail)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.perItemDetails.Add(perItemDetail);
            db.SaveChanges();

            return(CreatedAtRoute("DefaultApi", new { id = perItemDetail.id }, perItemDetail));
        }
        public IHttpActionResult DeleteperItemDetail(int id)
        {
            perItemDetail perItemDetail = db.perItemDetails.Find(id);

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

            db.perItemDetails.Remove(perItemDetail);
            db.SaveChanges();

            return(Ok(perItemDetail));
        }