Exemplo n.º 1
0
        public List <PlayerListViewModel> GetFreePlayers()
        {
            var playerProcessor = new PlayerProcessor();
            int idClub          = 2;
            var players         = new List <PlayerListViewModel>();

            try
            {
                var myPlayers = playerProcessor.RetrieveFreePlayers();

                foreach (var item in myPlayers)
                {
                    PlayerListViewModel player = new PlayerListViewModel();
                    player.setId(item.Id);
                    player.setFirstName(item.FirstName);
                    player.setLastName(item.LastName);

                    players.Add(player);
                }
            }
            catch (Exception e)
            {
                //players = null;
            }

            return(players);
        }