public IHttpActionResult Putcomment_emoji_details(long id, comment_emoji_details comment_emoji_details) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != comment_emoji_details.id) { return(BadRequest()); } db.Entry(comment_emoji_details).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!comment_emoji_detailsExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult Deletecomment_emoji_details(comment_emoji_details details) { var emoji = db.comment_emoji_details.Where(m => m.comment_id == details.comment_id && m.member_id == details.member_id && m.emoji_id == details.emoji_id && m.tourism_id == details.tourism_id).FirstOrDefault(); db.comment_emoji_details.Remove(emoji); db.SaveChanges(); return(Ok(emoji)); }
public IHttpActionResult Getcomment_emoji_details(long id) { comment_emoji_details comment_emoji_details = db.comment_emoji_details.Find(id); if (comment_emoji_details == null) { return(NotFound()); } return(Ok(comment_emoji_details)); }
public IHttpActionResult Postcomment_emoji_details(comment_emoji_details comment_emoji_details) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.comment_emoji_details.Add(comment_emoji_details); db.SaveChanges(); return(CreatedAtRoute("DefaultApi", new { id = comment_emoji_details.id }, comment_emoji_details)); }