Ejemplo n.º 1
0
        public async Task <IActionResult> Index(FixtureService fixtureService, string dateString = "")
        {
            DateTime date;

            if (dateString == "")
            {
                date = DateTime.Now;
            }
            else
            {
                date = DateTime.Parse(dateString.Substring(4, 11));
            }

            System.Diagnostics.Debug.WriteLine(date);

            IEnumerable <FixtureList> fixtureLists = await fixtureService.getDaysFixtures(date);

            FixturesViewModel viewModel = new FixturesViewModel {
                fixtureLists = fixtureLists, date = date
            };

            viewModel.predictionStats = fixtureService.getPredictionStats(new PredictionStats());

            return(View(viewModel));
        }