Exemple #1
0
        public List <PlayerPerformance.Player> GetPlayerPerformanceLst(PlayerRequest player)
        {
            PlayerJsonRequest vars = JsonConvert.DeserializeObject <PlayerJsonRequest>(player.PlayerJson);
            List <PlayerPerformance.Player> performLst = new List <PlayerPerformance.Player>();

            foreach (var items in player.PlayerIdLst)
            {
                vars.variables.matchId = player.MatchId;
                vars.variables.id      = items;
                vars.variables.tourId  = player.TourId;
                string json = JsonConvert.SerializeObject(vars);
                Dictionary <string, PlayerPerformance> performance = _playerRepo.ConstructJsonForPlayerPerformance(json);
                string[] teamArray                     = player.FullTeamName.Split("vs");
                string   convertedTeamName             = teamArray[1] + " Vs " + teamArray[0];
                PlayerPerformance.Player playerDetails = ConstructPlayerDetails(performance, convertedTeamName.Trim());
                playerDetails.PlayerId = items;
                performLst.Add(playerDetails);
            }
            return(performLst);
        }