Skip to content

Commit 94e6b0f

Browse files
committed
Ensure all properties in ValidateProperties are validated rather than stopping on first error
1 parent 58e9020 commit 94e6b0f

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

src/PeterLeslieMorris.Blazor.FluentValidation/PeterLeslieMorris.Blazor.FluentValidation.csproj

+4-7
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
<TargetFramework>netstandard2.1</TargetFramework>
55
<SignAssembly>true</SignAssembly>
66
<AssemblyOriginatorKeyFile>MrPMorris.snk</AssemblyOriginatorKeyFile>
7-
<AssemblyVersion>1.3.0.0</AssemblyVersion>
8-
<FileVersion>1.3.0.0</FileVersion>
9-
<Version>1.3.0</Version>
7+
<AssemblyVersion>1.3.1.0</AssemblyVersion>
8+
<FileVersion>1.3.1.0</FileVersion>
9+
<Version>1.3.1</Version>
1010
<Description>FluentValidation for Blazor</Description>
1111
<Copyright>Peter Morris</Copyright>
1212
<PackageLicenseFile>LICENCE</PackageLicenseFile>
@@ -20,6 +20,7 @@
2020

2121
<ItemGroup>
2222
<PackageReference Include="FluentValidation" Version="8.6.1" />
23+
<PackageReference Include="PeterLeslieMorris.Blazor.Validation" Version="1.3.1" />
2324
</ItemGroup>
2425

2526
<ItemGroup>
@@ -29,8 +30,4 @@
2930
</None>
3031
</ItemGroup>
3132

32-
<ItemGroup>
33-
<ProjectReference Include="..\PeterLeslieMorris.Blazor.Validation\PeterLeslieMorris.Blazor.Validation.csproj" />
34-
</ItemGroup>
35-
3633
</Project>

src/PeterLeslieMorris.Blazor.Validation/Extensions/EditContextExtensions.cs

+4-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,10 @@ public static bool ValidateProperties(this EditContext editContext, params Field
4545
if (properties == null || properties.Length == 0)
4646
throw new ArgumentNullException(nameof(properties));
4747

48-
return properties.All(x => editContext.ValidateProperty(x));
48+
bool valid = true;
49+
foreach (FieldIdentifier property in properties)
50+
valid &= editContext.ValidateProperty(property);
51+
return valid;
4952
}
5053

5154
private static void ValidateObject(

src/PeterLeslieMorris.Blazor.Validation/PeterLeslieMorris.Blazor.Validation.csproj

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<AddRazorSupportForMvc>true</AddRazorSupportForMvc>
99
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
1010
<PackageId>PeterLeslieMorris.Blazor.Validation</PackageId>
11-
<Version>1.3.0</Version>
11+
<Version>1.3.1</Version>
1212
<Authors>Peter Morris</Authors>
1313
<Company>Peter Morris</Company>
1414
<Product>PeterLeslieMorris.Blazor.Validation</Product>
@@ -19,8 +19,8 @@
1919
<PackageIconUrl>https://raw.githubusercontent.com/mrpmorris/blazor-validation/master/docs/images/blazor-validation-logo-small.png</PackageIconUrl>
2020
<RepositoryUrl>https://github.com/mrpmorris/blazor-validation</RepositoryUrl>
2121
<PackageTags>Blazor Validation</PackageTags>
22-
<AssemblyVersion>1.3.0.0</AssemblyVersion>
23-
<FileVersion>1.3.0.0</FileVersion>
22+
<AssemblyVersion>1.3.1.0</AssemblyVersion>
23+
<FileVersion>1.3.1.0</FileVersion>
2424
<SignAssembly>true</SignAssembly>
2525
<AssemblyOriginatorKeyFile>MrPMorris.snk</AssemblyOriginatorKeyFile>
2626
<DelaySign>false</DelaySign>

0 commit comments

Comments
 (0)