private async Task <int> AddCommentScore(int commentId, string username, LikeData.Score score) { CommentScores.Add(new CommentScore() { CommentId = commentId, Username = username, Score = score }); return(await SaveChangesAsync()); }
public async Task <CommentScore> GetCommentScore(int commentId, string username) { return(await CommentScores.FirstOrDefaultAsync(cs => cs.CommentId == commentId && cs.Username == username)); }
private async Task <int> DeleteCommentScore(int commentId, string username) { CommentScores.Remove(CommentScores.First(cs => cs.CommentId == commentId && cs.Username == username)); return(await SaveChangesAsync()); }