public void AddMatchPlayer(long matchId, MatchPlayer matchPlayer)
        {
            matchPlayer.match_id = matchId;
            matchPlayer.account_id = GetAccountId(matchPlayer.account_id);
            _matchPlayerAbilityRepository.AddMatchPlayerAbilities(matchPlayer);

            var matchPlayerItemRepository = new MatchPlayerItemRepository(matchPlayer, _db);
            matchPlayerItemRepository.AddMatchPlayerItems();

            _db.MatchPlayers.AddOrUpdate(matchPlayer);
        }
        public void AddMatchPlayer(long matchId, MatchPlayer matchPlayer)
        {
            matchPlayer.match_id   = matchId;
            matchPlayer.account_id = GetAccountId(matchPlayer.account_id);
            _matchPlayerAbilityRepository.AddMatchPlayerAbilities(matchPlayer);

            var matchPlayerItemRepository = new MatchPlayerItemRepository(matchPlayer, _db);

            matchPlayerItemRepository.AddMatchPlayerItems();

            _db.MatchPlayers.AddOrUpdate(matchPlayer);
        }
        public void CompleteMatchPlayer(MatchPlayer matchPlayer)
        {
            var heroId = matchPlayer.hero_id;
            var hero = _db.Heroes.First(h => h.id == heroId);
            matchPlayer.hero = hero;

            var accountId = matchPlayer.account_id;
            var playerInfo = _db.Players.FirstOrDefault(p => p.account_id == matchPlayer.account_id);
            matchPlayer.playerInformation = playerInfo;

            var matchPlayerItemRepository = new MatchPlayerItemRepository(matchPlayer,_db);
            var items = matchPlayerItemRepository.GetItems();
            matchPlayer.matchPlayerItems = items;

            var matchPlayerAbilities = _db.MatchPlayerAbilities.Where(mpa => mpa.account_id == matchPlayer.account_id
                                                                          && mpa.match_id == matchPlayer.match_id
                                                                          && mpa.player_slot == matchPlayer.player_slot);
            matchPlayer.ability_upgrades = matchPlayerAbilities.ToList();
        }
        public void CompleteMatchPlayer(MatchPlayer matchPlayer)
        {
            var heroId = matchPlayer.hero_id;
            var hero   = _db.Heroes.First(h => h.id == heroId);

            matchPlayer.hero = hero;

            var accountId  = matchPlayer.account_id;
            var playerInfo = _db.Players.FirstOrDefault(p => p.account_id == matchPlayer.account_id);

            matchPlayer.playerInformation = playerInfo;

            var matchPlayerItemRepository = new MatchPlayerItemRepository(matchPlayer, _db);
            var items = matchPlayerItemRepository.GetItems();

            matchPlayer.matchPlayerItems = items;

            var matchPlayerAbilities = _db.MatchPlayerAbilities.Where(mpa => mpa.account_id == matchPlayer.account_id &&
                                                                      mpa.match_id == matchPlayer.match_id &&
                                                                      mpa.player_slot == matchPlayer.player_slot);

            matchPlayer.ability_upgrades = matchPlayerAbilities.ToList();
        }