public IHttpActionResult PutTheory(int id, Theory theory)
        {
            if (!ModelState.IsValid)
            {
                return BadRequest(ModelState);
            }

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

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

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

            return StatusCode(HttpStatusCode.NoContent);
        }
        public IHttpActionResult PostTheory(Theory theory)
        {
            if (!ModelState.IsValid)
            {
                return BadRequest(ModelState);
            }

            db.Theories.Add(theory);
            db.SaveChanges();

            return CreatedAtRoute("DefaultApi", new { id = theory.TheoryId }, theory);
        }