public UserTeam localAddPlayer(List <Player> playerList, int matchid) { UserTeam userTeam = new UserTeam(); foreach (var player in playerList.Where(p => p.isSelected == true).ToList()) { userTeam.matchid = matchid; userTeam.players.Add(new Player2() { playerId = player.playerId, player = player, isCaptain = player.isCaptain, isViceCaptain = player.isViceCaptain //point = player.points }); } return(userTeam); }
public List <Player> GetPlayerList(UserTeam userplayers) { foreach (var player in userplayers.players) { players.Add(new Player() { playerId = player.player.playerId, firstName = player.player.firstName, lastName = player.player.lastName, age = player.player.age, address = player.player.address, playerRoleName = player.player.playerRoleName, teamId = player.player.teamId, team = player.player.team, image = player.player.image, points = player.player.points, credits = player.player.credits, isSelected = player.player.isSelected, isCaptain = player.player.isCaptain, isViceCaptain = player.player.isViceCaptain }); } return(players.ToList()); }