public IHttpActionResult PutSurvey_Types(int id, Survey_Types Survey_Types) { if (!ModelState.IsValid) { return BadRequest(ModelState); } if (id != Survey_Types.Survey_Type_ID) { return BadRequest(); } db.Entry(Survey_Types).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!Survey_TypesExists(id)) { return NotFound(); } else { throw; } } return StatusCode(HttpStatusCode.NoContent); }
public IHttpActionResult PostSurvey_Types(Survey_Types Survey_Types) { if (!ModelState.IsValid) { return BadRequest(ModelState); } db.Survey_Types.Add(Survey_Types); db.SaveChanges(); return CreatedAtRoute("DefaultApi", new { id = Survey_Types.Survey_Type_ID }, Survey_Types); }