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); }
public VeeValidateAttributeAdapterProvider(VeeValidateOptions options) { _options = options; }
public VeeValidateSnippets(VeeValidateOptions options) { _options = options; }