Exemplo n.º 1
0
        public IActionResult Index()
        {
            var runs      = _runFinder.GetFinished();
            var header    = _listConverter.Convert(runs);
            var viewmodel = new RunListViewModel(header);

            return(View(viewmodel));
        }
        public IEnumerable <RunAnalytics> Extend(int n)
        {
            var finishedRuns = _finder.GetFinished().OrderBy(x => x.Timings.StartedOn);
            var pbTime       = TimeSpan.MaxValue;

            var pbs = new List <RunAnalytics>();

            foreach (var run in finishedRuns)
            {
                if (run.Timings.RunTime < pbTime)
                {
                    pbTime = run.Timings.RunTime;
                    pbs.Add(run);
                }
            }

            if (n > 0)
            {
                return(pbs.OrderByDescending(x => x.Timings.StartedOn).Take(n));
            }

            return(pbs);
        }