public IHttpActionResult PutMultiplePerpetrator(int id, MultiplePerpetrator multiplePerpetrator) { if (!ModelState.IsValid) { return BadRequest(ModelState); } if (id != multiplePerpetrator.MultiplePerpetratorId) { return BadRequest(); } db.Entry(multiplePerpetrator).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!MultiplePerpetratorExists(id)) { return NotFound(); } else { throw; } } return StatusCode(HttpStatusCode.NoContent); }
public IHttpActionResult PostMultiplePerpetrator(MultiplePerpetrator multiplePerpetrator) { if (!ModelState.IsValid) { return BadRequest(ModelState); } db.MultiplePerpetrators.Add(multiplePerpetrator); db.SaveChanges(); return CreatedAtRoute("DefaultApi", new { id = multiplePerpetrator.MultiplePerpetratorId }, multiplePerpetrator); }