public async Task <Question> GetQuestionAsync(string questionId) { return(await _quizCache.GetValueFromKeyAsync(questionId, async (key) => { var result = await _quizDataAccess.GetByIdAsync("_id", key); return result.FirstOrDefault(); })); }
public Task <Answer> GetAnswer(string id) { return(_cache.GetValueFromKeyAsync(id, async key => { var result = await _quizDataAccess.GetByIdAsync("_id", key); return result.FirstOrDefault(); })); }
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; } }