public IEnumerable <EtfDisplay> Get(DateTime data, bool shorts, bool distributions) { int index = 0; var ranking = _rankingService.GetAll(data, shorts, distributions); return(ranking.Etfs .OrderByDescending(e => e.MediaTotRet) .Select(e => new EtfDisplay(++index, e))); }
private IEnumerable <EtfDisplay> GetAll(DateTime data, bool shorts, bool distributions, bool onlyEtcs = false) { int index = 0; var ranking = onlyEtcs ? _rankingService.GetAllEtcs(data, shorts, distributions) : _rankingService.GetAll(data, shorts, distributions); return(ranking.Etfs .OrderByDescending(e => e.MediaTotRet) .Select(e => new EtfDisplay(++index, e))); }
public IActionResult AllRanking(DateTime?dataRiferimento = null) { var ranking = _rankingService.GetAll(dataRiferimento); var model = RankingViewModel.FromEtfs(ranking); model.Title = "Ranking (All ETFs)"; model.Action = nameof(AllRanking); return(View("Ranking", model)); }