//============ Constructors =================// public GameService(int id) { _context = new Context(); _id = id; _gameStat = GameStatistic(_id, _context); _game = FetchGameByGameStatistic(_gameStat); }
private Game FetchGameByGameStatistic(GameStatistic gameStatistic) { var query = (from game in _context.Games where gameStatistic.GameRefNum == game.RefNum select game).Single(); return query; }
//============= Constructors =================// public GameViewModel(int id) { _gameService = new GameService(id); _gameStat = _gameService.GameStatistics(); }