public async Task <IActionResult> PutLikeCommentPosts(int id, LikeCommentPost likeCommentPost) { if (id != likeCommentPost.Id) { return(BadRequest()); } _context.Entry(likeCommentPost).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!LikeCommentPostExists(id)) { return(NotFound()); } else { throw; } } return(CreatedAtAction("GetLikeCommentPost", new { id = likeCommentPost.Id }, likeCommentPost)); }
public async Task <ActionResult <LikeCommentPost> > PostLikeCommentPost(LikeCommentPost like) { _context.LikeCommentPosts.Add(like); try { await _context.SaveChangesAsync(); } catch (DbUpdateException) { if (LikeCommentPosttExists(like.Id)) { return(Conflict()); } else { throw; } } return(like); }