public List <PlayerPerformance.Performance> GetIndividualPlayerPerformanceLst(PlayerRequest player) { PlayerJsonRequest vars = JsonConvert.DeserializeObject <PlayerJsonRequest>(player.PlayerJson); List <PlayerPerformance.Player> performLst = new List <PlayerPerformance.Player>(); vars.variables.matchId = player.MatchId; vars.variables.id = player.PlayerId; vars.variables.tourId = player.TourId; string json = JsonConvert.SerializeObject(vars); Dictionary <string, PlayerPerformance> performance = _playerRepo.ConstructJsonForPlayerPerformance(json); List <PlayerPerformance.Performance> playerStatsLst = GetPlayerStats(performance); return(playerStatsLst); }
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); }