public async Task <IActionResult> PutPost(int id, Post post) { if (id != post.PostId) { return(BadRequest()); } _context.Entry(post).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PostExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutFollow(int id, Follow follow) { if (id != follow.AccountId) { return(BadRequest()); } _context.Entry(follow).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!FollowExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }