예제 #1
0
파일: Client.cs 프로젝트: mvfavila/Dafa
        public bool IsValid()
        {
            var validation = new ClientIsVerifiedForRegistration();

            ValidationResult = validation.Validate(this);

            return(ValidationResult.IsValid);
        }
예제 #2
0
        public new ValidationResult Update(Client client)
        {
            var validationResult = new ValidationResult();

            if (!client.IsValid())
            {
                validationResult.AddError(client.ValidationResult);
                return(validationResult);
            }

            var validator         = new ClientIsVerifiedForRegistration();
            var validationService = validator.Validate(client);

            if (!validationService.IsValid)
            {
                validationResult.AddError(client.ValidationResult);
                return(validationResult);
            }

            clientRepository.Update(client);

            return(validationResult);
        }