public IActionResult List(int id)
        {
            dynamic TopicMenu = new ExpandoObject();

            TopicMenu.Forums = forumServices.GetForum(id);
            TopicMenu.Topics = topicServices.GetTopics(id);
            return(View(TopicMenu));
        }
Example #2
0
        public async Task <MessageModel <List <Topic> > > Get()
        {
            var data = new MessageModel <List <Topic> > {
                response = await _topicServices.GetTopics()
            };

            if (data.response != null)
            {
                data.success = true;
                data.msg     = "";
            }
            return(data);
        }
Example #3
0
        public async Task <IActionResult> GetTopics()
        {
            try
            {
                var isAuthenticated = User.Identity.IsAuthenticated;

                if (isAuthenticated)
                {
                    var currentLoggedUser = User.Identity.Name;
                    return(Ok(await _topicServices.GetTopics(currentLoggedUser)));
                }
                else
                {
                    return(BadRequest("Please Login!!"));
                }
            }
            catch (LoginException ex)
            {
                return(StatusCode(500, ex.Message));
            }
        }