Esempio n. 1
0
        // GET: Fixtures/Details/5
        public async Task <IActionResult> Details(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }
            Task <Fixture> fixture = _fixtureRepository.GetSingleFixture(id);

            if (await fixture == null)
            {
                return(NotFound());
            }

            return(View(await fixture));
        }
        // GET: Predictions/Create
        public async Task <IActionResult> Create(int id)
        {
            var fixture = await _fixturesRepository.GetSingleFixture(id);

            if (fixture.FixtureDateTime < DateTime.Now)
            {
                return(RedirectToAction("Index", "MyPredictr"));
            }

            if (fixture == null)
            {
                return(NotFound());
            }

            var currentPredictions = await _predictionsRepository.GetAll();

            PredictionHandler ph = new PredictionHandler(currentPredictions, _userProvider.GetUserId());

            VM_CreatePrediction _vm = ph.BuildCreateVMPrediction();

            return(View("Create", _vm));
        }