Esempio n. 1
0
        public static IServiceCollection AddVeeValidation(this IServiceCollection services, Action <VeeValidateOptions> optionsExpression = null)
        {
            var expr    = optionsExpression ?? delegate { };
            var options = new VeeValidateOptions();

            expr(options);

            services.TryAddSingleton(options);
            services.TryAddSingleton <VeeValidateSnippets>();
            services.TryAddTransient <IValidationAttributeAdapterProvider, VeeValidateAttributeAdapterProvider>();

            if (options.OverrideValidationTagHelpers)
            {
                services.TryAddSingleton <IHtmlGenerator, VeeValidateHtmlGenerator>();
            }

            return(services);
        }
Esempio n. 2
0
 public VeeValidateAttributeAdapterProvider(VeeValidateOptions options)
 {
     _options = options;
 }
Esempio n. 3
0
 public VeeValidateSnippets(VeeValidateOptions options)
 {
     _options = options;
 }