public async Task <ActionResult <IdeaFollower> > PostIdeaFollower(IdeaFollower ideaFollower) { _context.IdeaFollowers.Add(ideaFollower); await _context.SaveChangesAsync(); return(CreatedAtAction(nameof(GetIdeaFollower), new { id = ideaFollower.IdeaFollowerId }, ideaFollower)); }
public async Task <IActionResult> PutIdeaFollower(int id, IdeaFollower ideaFollower) { if (id != ideaFollower.IdeaFollowerId) { return(BadRequest()); } _context.Entry(ideaFollower).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!IdeaFollowerExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }