Skip to content

Commit

Permalink
Ensure all properties in ValidateProperties are validated rather than…
Browse files Browse the repository at this point in the history
… stopping on first error
  • Loading branch information
mrpmorris committed Feb 6, 2020
1 parent 58e9020 commit 94e6b0f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
<TargetFramework>netstandard2.1</TargetFramework>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>MrPMorris.snk</AssemblyOriginatorKeyFile>
<AssemblyVersion>1.3.0.0</AssemblyVersion>
<FileVersion>1.3.0.0</FileVersion>
<Version>1.3.0</Version>
<AssemblyVersion>1.3.1.0</AssemblyVersion>
<FileVersion>1.3.1.0</FileVersion>
<Version>1.3.1</Version>
<Description>FluentValidation for Blazor</Description>
<Copyright>Peter Morris</Copyright>
<PackageLicenseFile>LICENCE</PackageLicenseFile>
Expand All @@ -20,6 +20,7 @@

<ItemGroup>
<PackageReference Include="FluentValidation" Version="8.6.1" />
<PackageReference Include="PeterLeslieMorris.Blazor.Validation" Version="1.3.1" />
</ItemGroup>

<ItemGroup>
Expand All @@ -29,8 +30,4 @@
</None>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\PeterLeslieMorris.Blazor.Validation\PeterLeslieMorris.Blazor.Validation.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<AddRazorSupportForMvc>true</AddRazorSupportForMvc>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageId>PeterLeslieMorris.Blazor.Validation</PackageId>
<Version>1.3.0</Version>
<Version>1.3.1</Version>
<Authors>Peter Morris</Authors>
<Company>Peter Morris</Company>
<Product>PeterLeslieMorris.Blazor.Validation</Product>
Expand All @@ -19,8 +19,8 @@
<PackageIconUrl>https://raw.githubusercontent.com/mrpmorris/blazor-validation/master/docs/images/blazor-validation-logo-small.png</PackageIconUrl>
<RepositoryUrl>https://github.com/mrpmorris/blazor-validation</RepositoryUrl>
<PackageTags>Blazor Validation</PackageTags>
<AssemblyVersion>1.3.0.0</AssemblyVersion>
<FileVersion>1.3.0.0</FileVersion>
<AssemblyVersion>1.3.1.0</AssemblyVersion>
<FileVersion>1.3.1.0</FileVersion>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>MrPMorris.snk</AssemblyOriginatorKeyFile>
<DelaySign>false</DelaySign>
Expand Down

0 comments on commit 94e6b0f

Please sign in to comment.