diff --git a/zero.Core/Configuration/Integrations/IntegrationStore.cs b/zero.Core/Configuration/Integrations/IntegrationStore.cs index 68009cc2..2a73b9ed 100644 --- a/zero.Core/Configuration/Integrations/IntegrationStore.cs +++ b/zero.Core/Configuration/Integrations/IntegrationStore.cs @@ -137,9 +137,9 @@ public class IntegrationStore : IIntegrationStore result.Errors.Add(new ValidationFailure("__nofield", "@integration.errors.alreadycreated")); } - if (type != null && type.Validator != null) + if (type != null) { - ValidationResult innerResult = await type.Validator.ValidateAsync(new ValidationContext(model)); + ValidationResult innerResult = await Operations.Validate(model); result.Errors.AddRange(innerResult.Errors); } } diff --git a/zero.Core/Validation/ZeroMergedValidator.cs b/zero.Core/Validation/ZeroMergedValidator.cs index 5d3a5ac6..a33e5fe0 100644 --- a/zero.Core/Validation/ZeroMergedValidator.cs +++ b/zero.Core/Validation/ZeroMergedValidator.cs @@ -35,7 +35,7 @@ public class ZeroMergedValidator : IZeroMergedValidator /// public IEnumerable> ResolveFor(T model) { - Type type = typeof(T); + Type type = model.GetType(); if (!TypeCache.TryGetValue(type, out IEnumerable> validators)) {