public IHttpActionResult PutFeedbackReply(int id, FeedbackReply feedbackReply) { if (!ModelState.IsValid) { return BadRequest(ModelState); } if (id != feedbackReply.ID) { return BadRequest(); } db.Entry(feedbackReply).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!FeedbackReplyExists(id)) { return NotFound(); } else { throw; } } return StatusCode(HttpStatusCode.NoContent); }
public IHttpActionResult PostFeedbackReply(FeedbackReply feedbackReply) { if (!ModelState.IsValid) { return BadRequest(ModelState); } db.FeedbackReplies.Add(feedbackReply); db.SaveChanges(); return CreatedAtRoute("DefaultApi", new { id = feedbackReply.ID }, feedbackReply); }