Resvolution - ValidatorsResolver

This commit is contained in:
Stephan
2016-08-18 10:19:33 +02:00
parent b1d6757952
commit a45ffb71a4
8 changed files with 52 additions and 50 deletions

View File

@@ -407,17 +407,14 @@ namespace Umbraco.Core
ParameterEditorCollectionBuilder.Register(Container)
.AddProducer(() => PluginManager.ResolveParameterEditors());
//setup the validators resolver with our predefined validators
ValidatorsResolver.Current = new ValidatorsResolver(
ServiceProvider, ProfilingLogger.Logger, new[]
{
new Lazy<Type>(() => typeof (RequiredManifestValueValidator)),
new Lazy<Type>(() => typeof (RegexValidator)),
new Lazy<Type>(() => typeof (DelimitedManifestValueValidator)),
new Lazy<Type>(() => typeof (EmailValidator)),
new Lazy<Type>(() => typeof (IntegerValidator)),
new Lazy<Type>(() => typeof (DecimalValidator)),
});
// setup validators with our predefined validators
ValidatorCollectionBuilder.Register(Container)
.Add<RequiredManifestValueValidator>()
.Add<RegexValidator>()
.Add<DelimitedManifestValueValidator>()
.Add<EmailValidator>()
.Add<IntegerValidator>()
.Add<DecimalValidator>();
//by default we'll use the db server registrar unless the developer has the legacy
// dist calls enabled, in which case we'll use the config server registrar