public IActionResult QuestionPage(int id) { var repository = new QuestionsRepository(_conn); var vm = new QuestionPageViewModel(); vm.Question = repository.GetQuestionById(id); vm.Tags = repository.GetTagsByQuestion(vm.Question.QuestionsTags); vm.Answers = repository.GetAnswersByQuestionId(id); vm.IsLoggedIn = User.Identity.IsAuthenticated; if (User.Identity.IsAuthenticated) { vm.User = repository.GetUserByEmail(User.Identity.Name); vm.DidntLikeYet = repository.DidntLikeYet(id, vm.User.Id); } return(View(vm)); }