From 94e6b0f50e3e24922f040ced5689ff03dda198f7 Mon Sep 17 00:00:00 2001 From: Peter Morris Date: Thu, 6 Feb 2020 09:39:47 +0000 Subject: [PATCH] Ensure all properties in ValidateProperties are validated rather than stopping on first error --- .../PeterLeslieMorris.Blazor.FluentValidation.csproj | 11 ++++------- .../Extensions/EditContextExtensions.cs | 5 ++++- .../PeterLeslieMorris.Blazor.Validation.csproj | 6 +++--- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/PeterLeslieMorris.Blazor.FluentValidation/PeterLeslieMorris.Blazor.FluentValidation.csproj b/src/PeterLeslieMorris.Blazor.FluentValidation/PeterLeslieMorris.Blazor.FluentValidation.csproj index b0011e9..734d302 100644 --- a/src/PeterLeslieMorris.Blazor.FluentValidation/PeterLeslieMorris.Blazor.FluentValidation.csproj +++ b/src/PeterLeslieMorris.Blazor.FluentValidation/PeterLeslieMorris.Blazor.FluentValidation.csproj @@ -4,9 +4,9 @@ netstandard2.1 true MrPMorris.snk - 1.3.0.0 - 1.3.0.0 - 1.3.0 + 1.3.1.0 + 1.3.1.0 + 1.3.1 FluentValidation for Blazor Peter Morris LICENCE @@ -20,6 +20,7 @@ + @@ -29,8 +30,4 @@ - - - - diff --git a/src/PeterLeslieMorris.Blazor.Validation/Extensions/EditContextExtensions.cs b/src/PeterLeslieMorris.Blazor.Validation/Extensions/EditContextExtensions.cs index 1fb5d49..571e72f 100644 --- a/src/PeterLeslieMorris.Blazor.Validation/Extensions/EditContextExtensions.cs +++ b/src/PeterLeslieMorris.Blazor.Validation/Extensions/EditContextExtensions.cs @@ -45,7 +45,10 @@ public static bool ValidateProperties(this EditContext editContext, params Field if (properties == null || properties.Length == 0) throw new ArgumentNullException(nameof(properties)); - return properties.All(x => editContext.ValidateProperty(x)); + bool valid = true; + foreach (FieldIdentifier property in properties) + valid &= editContext.ValidateProperty(property); + return valid; } private static void ValidateObject( diff --git a/src/PeterLeslieMorris.Blazor.Validation/PeterLeslieMorris.Blazor.Validation.csproj b/src/PeterLeslieMorris.Blazor.Validation/PeterLeslieMorris.Blazor.Validation.csproj index 3c9095e..2bb0d1d 100644 --- a/src/PeterLeslieMorris.Blazor.Validation/PeterLeslieMorris.Blazor.Validation.csproj +++ b/src/PeterLeslieMorris.Blazor.Validation/PeterLeslieMorris.Blazor.Validation.csproj @@ -8,7 +8,7 @@ true true PeterLeslieMorris.Blazor.Validation - 1.3.0 + 1.3.1 Peter Morris Peter Morris PeterLeslieMorris.Blazor.Validation @@ -19,8 +19,8 @@ https://raw.githubusercontent.com/mrpmorris/blazor-validation/master/docs/images/blazor-validation-logo-small.png https://github.com/mrpmorris/blazor-validation Blazor Validation - 1.3.0.0 - 1.3.0.0 + 1.3.1.0 + 1.3.1.0 true MrPMorris.snk false