private void FillController(int id) { Predictions = new List <MyPredictionEditModel>(); var games = _gameData.GetAll(); MyUser = _userData.Get(id); var currentTime = DateTime.Now; foreach (var game in games) { var prediction = _predictionData.GetForUser(MyUser.Id, game.Id); if (prediction == null) { Predictions.Add(_predictionConverter.ToMyPredictionEditModel(game, currentTime)); } else { prediction.User = MyUser; Predictions.Add(_predictionConverter.ToMyPredictionEditModel(prediction, currentTime)); } } }
public IActionResult OnGet() { Games = _gameData.GetAll(); return(Page()); }
public void OnGet() { Games = gameData.GetAll(); }
// GET: Game public ActionResult Index() { var model = db.GetAll().ToList(); return(View(model)); }