Exemplo n.º 1
0
        /// <summary>
        ///     Gets all themes from repository
        /// </summary>
        /// <returns>returns the list of all themes</returns>
        public List <Theme> GetAllThemes()
        {
            var themes = _themeRepository.GetAllThemes();

            foreach (var theme in themes)
            {
                theme.CourseCount = _courseService.GetCoursesByTheme(theme.ThemeId).Count();
            }
            return(themes);
        }
Exemplo n.º 2
0
 public JsonResult Get()
 {
     try
     {
         var result = Mapper.Map <IEnumerable <ThemeViewModel> >(_repository.GetAllThemes());
         return(new JsonResult(result));
     }
     catch (Exception ex)
     {
         _logger.LogError(ex.Message);
         Response.StatusCode = (int)HttpStatusCode.BadRequest;
         return(Json(new { ex.Message }));
     }
 }
Exemplo n.º 3
0
 public IEnumerable <Theme> GetAllThemes()
 {
     return(_themeRepository.GetAllThemes());
 }
Exemplo n.º 4
0
 public async Task <Theme[]> GetAllThemes() => await themeRepository.GetAllThemes();
Exemplo n.º 5
0
 public IActionResult Index(int?forumId)
 {
     return(View(_repository.GetAllThemes(forumId)));
 }