public override ValidationResult Validate()
        {
            var roundValidator   = new RoundValidator();
            var validationResult = roundValidator.Validate(this);

            SetValidationResult(validationResult);

            return(validationResult);
        }
Exemple #2
0
        public Round Create(double x, double y, double radius, out IEnumerable <ValidationFailure> listError)
        {
            var validator = new RoundValidator();
            var tempRound = new Round(x, y, radius);

            var result = validator.Validate(tempRound);

            if (result.IsValid == false)
            {
                listError = result.Errors;
                return(null);
            }

            listError = new List <ValidationFailure>();

            return(tempRound);
        }