public IHttpActionResult PostCategoryCode(CategoryCode categoryCode)
        {
            if (!ModelState.IsValid)
            {
                return BadRequest(ModelState);
            }

            db.categoryCodes.Add(categoryCode);
            db.SaveChanges();

            return CreatedAtRoute("DefaultApi", new { id = categoryCode.id }, categoryCode);
        }
        public IHttpActionResult PutCategoryCode(int id, CategoryCode categoryCode)
        {
            if (!ModelState.IsValid)
            {
                return BadRequest(ModelState);
            }

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

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

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

            return StatusCode(HttpStatusCode.NoContent);
        }