Ejemplo n.º 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));
        }
Ejemplo n.º 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));
        }
Ejemplo n.º 3
0
 public Guid?Remove(Guid id)
 {
     return(PlayersRepository.Remove(id));
 }