예제 #1
0
        private List <ValidationResult> Validate(Item item)
        {
            // Validate item
            var itemValidator = new EntityValidator <Item>();

            _validationErrors.AddRange(itemValidator.GetValidationErrors(item));

            // Validate header
            if (item.Header != null)
            {
                var headerValidator = new EntityValidator <Header>();
                _validationErrors.AddRange(headerValidator.GetValidationErrors(item.Header));
            }

            // Validate entry
            if (item.Entry != null)
            {
                var entryValidator = new EntityValidator <Entry>();
                _validationErrors.AddRange(entryValidator.GetValidationErrors(item.Entry));
            }

            return(_validationErrors);
        }
예제 #2
0
        private List<ValidationResult> Validate(Item item)
        {
            // Validate item
            var itemValidator = new EntityValidator<Item>();
            _validationErrors.AddRange(itemValidator.GetValidationErrors(item));

            // Validate header
            if (item.Header != null)
            {
                var headerValidator = new EntityValidator<Header>();
                _validationErrors.AddRange(headerValidator.GetValidationErrors(item.Header));
            }

            // Validate entry
            if (item.Entry != null)
            {
                var entryValidator = new EntityValidator<Entry>();
                _validationErrors.AddRange(entryValidator.GetValidationErrors(item.Entry));
            }

            return _validationErrors;
        }