public void Upvote(QuestionUpvote questionUpvote) { var voteExists = Db.FirstOrDefault <Models.DataModels.QuestionUpvote>("WHERE [UserId] = @0 AND [QuestionId] = @1", questionUpvote.UserId, questionUpvote.QuestionId); if (voteExists == null) { var newVote = new Models.DataModels.QuestionUpvote { UserId = questionUpvote.UserId, QuestionId = questionUpvote.QuestionId }; Db.Insert("QuestionUpVotes", newVote); } }
public void Upvote([FromBody] QuestionUpvote questionUpvote) { QuestionService.Upvote(questionUpvote); }