public IHttpActionResult PutsoumissionParticuliere(int id, soumissionParticuliere soumissionParticuliere) { if (!ModelState.IsValid) { return BadRequest(ModelState); } if (id != soumissionParticuliere.idSoumPart) { return BadRequest(); } db.Entry(soumissionParticuliere).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!soumissionParticuliereExists(id)) { return NotFound(); } else { throw; } } return StatusCode(HttpStatusCode.NoContent); }
public IHttpActionResult PostsoumissionParticuliere(soumissionParticuliere soumissionParticuliere) { if (!ModelState.IsValid) { return BadRequest(ModelState); } db.soumissionParticuliere.Add(soumissionParticuliere); db.SaveChanges(); return CreatedAtRoute("DefaultApi", new { id = soumissionParticuliere.idSoumPart }, soumissionParticuliere); }