Пример #1
0
        public ActionResult Index()
        {
            Thread thread = new Thread(new ThreadStart(AddNews));

            thread.Start();
            var news = _news.GetAll();

            return(View(news));
        }
Пример #2
0
        public async Task <ViewResult> Index()
        {
            var news = await _newsData.GetAll();

            var model = new HomePageViewModel
            {
                Messages        = news,
                CurrentGreeting = _greeter.GetGreeting()
            };

            return(View(model));
        }