コード例 #1
0
        public IActionResult Index()
        {
            var directorList = _directorService.GetAllDirectors();

            if (directorList != null)
            {
                _logger.LogInformation(LoggerMessageDisplay.DirectorsListed);
            }
            else
            {
                _logger.LogInformation(LoggerMessageDisplay.NoDirectorsInDB);
            }
            return(View(directorList));
        }
コード例 #2
0
        public IActionResult Create()
        {
            var Genres    = _genreService.GetAllGenres();
            var Directors = _directorService.GetAllDirectors();

            MovieViewModel movieViewlModel = new MovieViewModel();

            movieViewlModel.Genres    = GetSelectListItemsGenres(Genres);
            movieViewlModel.Directors = GetSelectListItemsDirectors(Directors);
            if (Genres != null && Directors != null)
            {
                _logger.LogInformation(LoggerMessageDisplay.MovieCreated);
            }
            else
            {
                _logger.LogInformation(LoggerMessageDisplay.MovieCreatedNotFound);
            }
            return(View(movieViewlModel));
        }