Ejemplo n.º 1
0
        public IActionResult Index()
        {
            PCGame fallout = new PCGame()
            {
                Name     = "Fallout 4",
                Language = "C++"
            };

            PCGame stalker = new PCGame()
            {
                Name     = "S.T.A.L.K.E.R.",
                Language = "C++ & Lua Script"
            };

            PCGame masseffect = new PCGame()
            {
                Name     = "Mass Effect",
                Language = "C++"
            };

            List <PCGame> PCGamesCollection = new List <PCGame>();

            PCGamesCollection.Add(fallout);
            PCGamesCollection.Add(stalker);
            PCGamesCollection.Add(masseffect);

            XBoxGame minecraft = new XBoxGame()
            {
                Name     = "Minecraft",
                Language = "Java"
            };

            XBoxGame obsolete = new XBoxGame()
            {
                Name     = "Obsolete",
                Language = "C#"
            };

            XBoxGame crysis = new XBoxGame()
            {
                Name     = "Crysis",
                Language = "C++"
            };

            List <XBoxGame> XBoxGamesCollection = new List <XBoxGame>();

            XBoxGamesCollection.Add(minecraft);
            XBoxGamesCollection.Add(obsolete);
            XBoxGamesCollection.Add(crysis);

            GamesViewModel viewModel = new GamesViewModel()
            {
                PCGames   = PCGamesCollection,
                XBoxGames = XBoxGamesCollection
            };

            return(View(viewModel));
        }
        public IActionResult Index()
        {
            PCGame pCGame = new PCGame
            {
                Company = "Blizzard",
                Name    = "World of warcraft"
            };
            PCGame pCGame1 = new PCGame
            {
                Company = "Blizzard",
                Name    = "Overwatch"
            };
            PCGame pCGame2 = new PCGame
            {
                Company = "Blizzard",
                Name    = "Diablo"
            };

            XBoxGame xBoxGame = new XBoxGame
            {
                Company = "Valve",
                Name    = "Dota"
            };
            XBoxGame xBoxGame1 = new XBoxGame
            {
                Company = "Valve",
                Name    = "Rocket"
            };
            XBoxGame xBoxGame2 = new XBoxGame
            {
                Company = "Valve",
                Name    = "CS"
            };

            List <PCGame> pCGames = new List <PCGame>();

            pCGames.Add(pCGame);
            pCGames.Add(pCGame1);
            pCGames.Add(pCGame2);

            List <XBoxGame> xBoxGames = new List <XBoxGame>();

            xBoxGames.Add(xBoxGame);
            xBoxGames.Add(xBoxGame1);
            xBoxGames.Add(xBoxGame2);

            GameViewModel gameViewModel = new GameViewModel()
            {
                PCGames   = pCGames,
                XBoxGames = xBoxGames
            };

            return(View(gameViewModel));
        }
Ejemplo n.º 3
0
        public IActionResult Index()
        {
            PCGame pCGame1 = new PCGame
            {
                Name    = "WOW",
                Company = "Blizzard"
            };
            PCGame pCGame2 = new PCGame
            {
                Name    = "WOW2",
                Company = "Blizzard2"
            };
            PCGame pCGame3 = new PCGame
            {
                Name    = "WOW3",
                Company = "Blizzard3"
            };
            XBoxGame xBoxGame1 = new XBoxGame
            {
                Name    = "dota",
                Company = "valve"
            };
            XBoxGame xBoxGame2 = new XBoxGame
            {
                Name    = "dota2",
                Company = "valve2"
            };
            XBoxGame xBoxGame3 = new XBoxGame
            {
                Name    = "dota3",
                Company = "valve3"
            };
            List <PCGame>   pCGames   = new List <PCGame>();
            List <XBoxGame> xBoxGames = new List <XBoxGame>();

            pCGames.Add(pCGame1);
            pCGames.Add(pCGame2);
            pCGames.Add(pCGame3);
            xBoxGames.Add(xBoxGame1);
            xBoxGames.Add(xBoxGame2);
            xBoxGames.Add(xBoxGame3);
            ViewModelGames viewModelGames = new ViewModelGames
            {
                PCGames   = pCGames,
                XBoxGames = xBoxGames
            };

            return(View(viewModelGames));
        }