// PUT api/EventSymposium/5 public IHttpActionResult PutEvent_Symposium(int id, Event_Symposium event_symposium) { if (!ModelState.IsValid) { return BadRequest(ModelState); } if (id != event_symposium.Reg_ID) { return BadRequest(); } db.Entry(event_symposium).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!Event_SymposiumExists(id)) { return NotFound(); } else { throw; } } return StatusCode(HttpStatusCode.NoContent); }
public IHttpActionResult PostEvent_Symposium(Event_Symposium event_symposium) { if (!ModelState.IsValid) { return BadRequest(ModelState); } db.Event_Symposium.Add(event_symposium); db.SaveChanges(); return CreatedAtRoute("DefaultApi", new { id = event_symposium.Reg_ID }, event_symposium); }