Exemplo n.º 1
0
        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));
                }
            }
        }
Exemplo n.º 2
0
 public IActionResult OnGet()
 {
     Games = _gameData.GetAll();
     return(Page());
 }
Exemplo n.º 3
0
 public void OnGet()
 {
     Games = gameData.GetAll();
 }
Exemplo n.º 4
0
        // GET: Game
        public ActionResult Index()
        {
            var model = db.GetAll().ToList();

            return(View(model));
        }