Example #1
0
        public CreatedPlayerDTO Create(string name)
        {
            var player           = new Player(name);
            var playerValidation = player.Validate();

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

            return(new CreatedPlayerDTO(playerValidation.errors));
        }
Example #2
0
        public CreatedPlayerDto Create(string name)
        {
            var player         = new Player(name);
            var validatePlayer = player.Validate();

            if (validatePlayer.isValid)
            {
                PlayersRepository.Add(player);
                return(new CreatedPlayerDto(player.Id));
            }

            return(new CreatedPlayerDto(validatePlayer.errors));
        }
Example #3
0
 public Guid?Remove(Guid id)
 {
     return(PlayersRepository.Remove(id));
 }