public ActionResult Index() { var viewModel = new IndexNewsViewModel() { News = this.news.GetAll().To <NewsViewModel>().ToList() }; return(this.View(viewModel)); }
public async Task <IndexNewsViewModel> GetHotStocksForFeeding(int newsCount) { var result = new IndexNewsViewModel(); var newsList = await GetHotStocks(newsCount).ToListAsync(); result.News = MapFinwireNewToViewModel(newsList); return(result); }
public ActionResult Index() { var viewModel = new IndexNewsViewModel() { News = this.news.GetAll().To<NewsViewModel>().ToList() }; return this.View(viewModel); }
public async Task <IndexNewsViewModel> GetMainNewsForFeeding(int newsCount) { var result = new IndexNewsViewModel(); var newsList = await GetNewsForFeedingWithPrio(newsCount); result.News = MapFinwireNewToViewModel(newsList); var first = result.News.FirstOrDefault(); if (first?.IsFinwireNews ?? false) { first.IsTopFinwireNews = true; } return(result); }
public ActionResult CreateNews(IndexNewsViewModel model) { this.news.CreateNews(this.Mapper.Map <News>(model.InputModel)); return(this.RedirectToAction("Index")); }
public async Task <IActionResult> Index() { var indexViewModel = new IndexNewsViewModel(await _newsRepository.GetSliderNewsAsync(), await _newsRepository.GetLatestNewsAsync()); return(View(indexViewModel)); }
public ActionResult CreateNews(IndexNewsViewModel model) { this.news.CreateNews(this.Mapper.Map<News>(model.InputModel)); return this.RedirectToAction("Index"); }