public bool Remove(Guid id)
        {
            var foundPlayer = _playersRepository.Get(player => player.Id == id);

            _playersRepository.Remove(foundPlayer);
            return(true);
        }
Exemple #2
0
        public CreatedPlayerDTO Update(Guid id, string name)
        {
            var player           = new Player(name);
            var playerValidation = player.Validate();

            if (playerValidation.isValid)
            {
                PlayersRepository.Remove(id);
                PlayersRepository.Add(player);
                return(new CreatedPlayerDTO(player.Id));
            }

            return(new CreatedPlayerDTO(playerValidation.errors));
        }
Exemple #3
0
 public Guid?Remove(Guid id)
 {
     return(PlayersRepository.Remove(id));
 }