private async Task <bool> RefreshCaches(bool ForceRefresh = false)
        {
            if (PairCache == null || ForceRefresh)
            {
                PairCache = PairDatabaseProvider.GetAll();
            }
            if (QuestionCache == null || ForceRefresh)
            {
                QuestionCache = QuestionDatabaseProvider.GetAll();
            }
            if (UserPairScoreCache == null || ForceRefresh)
            {
                UserPairScoreCache = UserPairScoreDatabaseProvider.GetAll();
            }


            return(await Task.FromResult(true));
        }
        private void UpdateUserPairScoreRepository(Question question, bool wasAnswerIsCorrect, int userId, int dictionaryId)
        {
            var userPairScore = UserPairScoreCache.Where(q => q.PairId == question.PairID).FirstOrDefault();

            if (userPairScore == null)
            {
                userPairScore = new UserPairScore()
                {
                    UserId       = userId,
                    DictionaryId = dictionaryId,
                    TotalCorrect = wasAnswerIsCorrect ? 1 : 0,
                    TotalWrong   = wasAnswerIsCorrect ? 0 : 1
                };

                UserPairScoreDatabaseProvider.Add(userPairScore);
            }
            else
            {
                userPairScore.TotalCorrect += wasAnswerIsCorrect ? 1 : 0;
                userPairScore.TotalWrong   += wasAnswerIsCorrect ? 0 : 1;
                UserPairScoreDatabaseProvider.Update(userPairScore);
            }
        }