Esempio n. 1
0
 public async Task <Question> GetQuestionAsync(string questionId)
 {
     return(await _quizCache.GetValueFromKeyAsync(questionId, async (key) => {
         var result = await _quizDataAccess.GetByIdAsync("_id", key);
         return result.FirstOrDefault();
     }));
 }
Esempio n. 2
0
 public Task <Answer> GetAnswer(string id)
 {
     return(_cache.GetValueFromKeyAsync(id, async key => {
         var result = await _quizDataAccess.GetByIdAsync("_id", key);
         return result.FirstOrDefault();
     }));
 }
Esempio n. 3
0
 public async Task <Topic> GetTopicAsync(string id)
 {
     try
     {
         return(await _quizCache.GetValueFromKeyAsync(id, async (key) =>
         {
             var result = await _quizDataAccess.GetByIdAsync("_id", key);
             return result.FirstOrDefault();
         }));
     }
     catch (Exception)
     {
         throw;
     }
 }