Exemple #1
0
        public IndexModel(IOptions <Greetings> greetings, IMovieData movieData)
        {
            MovieCount = movieData.Count();
            if (DateTime.UtcNow.Hour > 12)
            {
                Message = greetings.Value.Evening;
            }
            else
            {
                Message = greetings.Value.Morning;
            }

            this.movieData = movieData;
        }
Exemple #2
0
        public void OnGet()
        {
            logger.LogInformation($"Executing {nameof(OnGet)}");

            MovieCount = movieData.Count();

            if (DateTime.Now.Hour <= 12)
            {
                Message = greetings.Morning;
            }
            else
            {
                Message = greetings.Evening;
            }
        }