Exemplo n.º 1
0
        public async Task <Question> getLastQuestion()
        {
            var maxId = applicationDbContext.Questions.Max(q => q.Id);
            var res   = await applicationDbContext.Questions.Include(q => q.User).FirstOrDefaultAsync(q => q.Id == maxId);

            res.ratingCalculate = new QuestionRating();
            var react = reactionRepository.GetReactionsForPost(maxId, PostType.QUESTION);

            res.ratingCalculate.SetReactions(react);
            return(res);
        }