Пример #1
0
        public ValidationContext(IServiceProvider serviceProvider, IOptions <ValidationOptions> validationOptions)
        {
            this.serviceProvider = serviceProvider;

            ValidationDetails  = new ValidationDetailsCollection();
            ValidationSeverity = validationOptions.Value.ValidationSeverity;
            ValidationPath     = validationOptions.Value.ValidationPath;
        }
Пример #2
0
        public ValidationScope(
            IValidationContext validationContext,
            string validationPath,
            ValidationSeverity?validationSeverity)
        {
            ValidationPath     = validationPath;
            ValidationDetails  = new ValidationDetailsCollection(validationContext.ValidationDetails);
            ValidationSeverity = validationSeverity ?? validationContext.ValidationSeverity;

            serviceProvider = (IServiceProvider)validationContext;
        }