public async Task<IHttpActionResult> PutEvaluationDetail(int id, EvaluationDetail evaluationDetail) { if (!ModelState.IsValid) { return BadRequest(ModelState); } if (id != evaluationDetail.EvaluationDetailNo) { return BadRequest(); } db.Entry(evaluationDetail).State = EntityState.Modified; try { await db.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!EvaluationDetailExists(id)) { return NotFound(); } else { throw; } } return StatusCode(HttpStatusCode.NoContent); }
public async Task<IHttpActionResult> PostEvaluationDetail(EvaluationDetail evaluationDetail) { if (!ModelState.IsValid) { return BadRequest(ModelState); } db.EvaluationDetails.Add(evaluationDetail); await db.SaveChangesAsync(); return CreatedAtRoute("DefaultApi", new { id = evaluationDetail.EvaluationDetailNo }, evaluationDetail); }