protected override ValidationResult IsValid(object value, ValidationContext validationContext)
        {
            var playerRanks = (value as IEnumerable <IPlayerRank>).ToList();

            try
            {
                PlayerRankValidator.ValidatePlayerRanks(playerRanks);

                return(ValidationResult.Success);
            }catch (ArgumentException argumentException)
            {
                return(new ValidationResult(argumentException.Message));
            }
        }
Beispiel #2
0
        protected override ValidationResult IsValid(object value, ValidationContext validationContext)
        {
            List <PlayerRank> playerRanks = value as List <PlayerRank>;

            try
            {
                PlayerRankValidator.ValidatePlayerRanks(playerRanks);

                return(ValidationResult.Success);
            }catch (ArgumentException argumentException)
            {
                return(new ValidationResult(argumentException.Message));
            }
        }