Esempio n. 1
0
        public IActionResult Topic(int id, string mode = "default")
        {
            TopicViewModel topicView = Mapper.Map <TopicViewModel>(TopicRepository.GetTopicById(id));

            topicView.SetUserRating(User.Identity.GetUserId());
            return(View(topicView));
        }
Esempio n. 2
0
        // GET: Topics/Details/5
        public async Task <IActionResult> Details(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            var topic = await _repository.GetTopicById(id.Value);

            if (topic == null)
            {
                return(NotFound());
            }

            return(View(topic));
        }
Esempio n. 3
0
 public Topic GetTopicById(int topicId)
 {
     return(_topicRepository.GetTopicById(topicId));
 }