public IEnumerable <GameElement> LowPriorityGames(int page) { var lowPrioArray = db.LowPriorityGames .Include(g => g.Game) .ThenInclude(g => g.Genre) .ToArray(); var viewModel = new List <GameElement>(); foreach (var low in lowPrioArray) { string releaseDate = DateToString.GetYearOnly(low.Game.ReleaseDate); var elem = new GameElement() { Id = low.Game.GameId, GenreName = low.Game.Genre.Name, ImagePath = Util.GetImageFilePath(low.Game.ImagePath), Name = low.Game.Name, ReleaseDate = releaseDate }; viewModel.Add(elem); } return(viewModel); }
public IEnumerable <GameElement> FinishedGames(int page) { var finishedArray = db.FinishedGames .Include(g => g.GameRating) .Include(g => g.Game) .ThenInclude(g => g.Genre) .ToArray(); var viewModel = new List <GameElement>(); foreach (var finished in finishedArray) { string releaseDate = DateToString.GetYearOnly(finished.Game.ReleaseDate); var elem = new GameElement() { Id = finished.GameId, GenreName = finished.Game.Genre.Name, ImagePath = Util.GetImageFilePath(finished.Game.ImagePath), Name = finished.Game.Name, ReleaseDate = releaseDate }; viewModel.Add(elem); } return(viewModel); }
public IEnumerable <GameElement> UnfinishedGames(int foo) { var unfinishedGames = db.BacklogGames .Include(g => g.Game) .ThenInclude(g => g.Genre) .ToArray(); var viewModel = new List <GameElement>(); foreach (var unfinished in unfinishedGames) { var releaseDate = DateToString.GetYearOnly(unfinished.Game.ReleaseDate); var elem = new GameElement() { Id = unfinished.BacklogGameId, Name = unfinished.Game.Name, GenreName = unfinished.Game.Genre.Name, ReleaseDate = releaseDate, ImagePath = Util.GetImageFilePath(unfinished.Game.ImagePath) }; viewModel.Add(elem); } return(viewModel); }
public IEnumerable <GameElement> Games(int page) { var games = db.Games .Include(g => g.Genre) .ToArray(); var viewModel = new List <GameElement>(); foreach (var game in games) { string releaseDate = DateToString.GetYearOnly(game.ReleaseDate); var elem = new GameElement() { Id = game.GameId, Name = game.Name, ReleaseDate = releaseDate, GenreName = game.Genre.Name, ImagePath = Util.GetImageFilePath(game.ImagePath) }; viewModel.Add(elem); } return(viewModel); }