File tree Expand file tree Collapse file tree 12 files changed +51
-54
lines changed
01-DataAnnotationsValidation/DataAnnotationsValidationSample
02-FluentValidation/FluentValidationSample
PeterLeslieMorris.Blazor.FluentValidation
PeterLeslieMorris.Blazor.Validation Expand file tree Collapse file tree 12 files changed +51
-54
lines changed Original file line number Diff line number Diff line change @@ -47,6 +47,14 @@ More sample projects will be added as the framework develops.
47
47
- [ FluentValidation Sample] - Shows how to use the [ FluentValidation.com] library to validate.
48
48
49
49
## What's new
50
+
51
+ ### New in 1.7.0
52
+ - Upgrade to FluentValidation V10
53
+ - Prevent ValidateObjectTree from visiting struct properties [ Bug #33 ] ( https://github.com/mrpmorris/blazor-validation/issues/33 )
54
+
55
+ ### New in 1.6.0
56
+ - Suport FluentValidation's RuleForEach and ChildRules
57
+
50
58
### New in 1.5.0
51
59
- Support .NET 5.0
52
60
Original file line number Diff line number Diff line change 1
- <Router AppAssembly =" typeof(Program).Assembly" >
2
- <Found Context =" routeData" >
3
- <RouteView RouteData =" routeData" />
4
- </Found >
5
- <NotFound >
6
- <p >Sorry, there's nothing at this address.</p >
7
- </NotFound >
1
+ <Router AppAssembly =" @typeof(Program).Assembly" >
2
+ <Found Context =" routeData" >
3
+ <RouteView RouteData =" @routeData" DefaultLayout =" @typeof(MainLayout)" />
4
+ </Found >
5
+ <NotFound >
6
+ <LayoutView Layout =" @typeof(MainLayout)" >
7
+ <p >Sorry, there's nothing at this address.</p >
8
+ </LayoutView >
9
+ </NotFound >
8
10
</Router >
Original file line number Diff line number Diff line change 6
6
</PropertyGroup >
7
7
8
8
<ItemGroup >
9
- <PackageReference Include =" Microsoft.AspNetCore.Blazor" Version =" 3.1.0-preview4.19579.2" />
10
- <PackageReference Include =" Microsoft.AspNetCore.Blazor.Build" Version =" 3.1.0-preview4.19579.2" PrivateAssets =" all" />
11
- <PackageReference Include =" Microsoft.AspNetCore.Blazor.HttpClient" Version =" 3.1.0-preview4.19579.2" />
12
- <PackageReference Include =" Microsoft.AspNetCore.Blazor.DevServer" Version =" 3.1.0-preview4.19579.2" PrivateAssets =" all" />
9
+ <PackageReference Include =" Microsoft.AspNetCore.Components.WebAssembly" Version =" 3.2.1" />
10
+ <PackageReference Include =" Microsoft.AspNetCore.Components.WebAssembly.Build" Version =" 3.2.1" PrivateAssets =" all" />
11
+ <PackageReference Include =" Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version =" 3.2.1" PrivateAssets =" all" />
13
12
</ItemGroup >
14
13
15
14
<ItemGroup >
Original file line number Diff line number Diff line change 1
- using Microsoft . AspNetCore . Blazor . Hosting ;
1
+ using Microsoft . AspNetCore . Components . WebAssembly . Hosting ;
2
+ using Microsoft . Extensions . DependencyInjection ;
3
+ using PeterLeslieMorris . Blazor . Validation ;
4
+ using System ;
5
+ using System . Net . Http ;
6
+ using System . Threading . Tasks ;
2
7
3
8
namespace DataAnnotationsValidationSample
4
9
{
5
10
public class Program
6
11
{
7
- public static void Main ( string [ ] args )
12
+ public static async Task Main ( string [ ] args )
8
13
{
9
- CreateHostBuilder ( args ) . Build ( ) . Run ( ) ;
10
- }
14
+ var builder = WebAssemblyHostBuilder . CreateDefault ( args ) ;
15
+ builder . RootComponents . Add < App > ( "app" ) ;
16
+
17
+ builder . Services . AddScoped ( sp => new HttpClient { BaseAddress = new Uri ( builder . HostEnvironment . BaseAddress ) } ) ;
18
+ builder . Services . AddFormValidation ( config => config . AddDataAnnotationsValidation ( ) ) ;
11
19
12
- public static IWebAssemblyHostBuilder CreateHostBuilder ( string [ ] args ) =>
13
- BlazorWebAssemblyHost . CreateDefaultBuilder ( )
14
- . UseBlazorStartup < Startup > ( ) ;
20
+ await builder . Build ( ) . RunAsync ( ) ;
21
+ }
15
22
}
16
23
}
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 5
5
@using Microsoft .JSInterop
6
6
@using DataAnnotationsValidationSample
7
7
@using DataAnnotationsValidationSample .Components
8
- @using DataAnnotationsValidationSample .Shared
8
+ @using DataAnnotationsValidationSample .Shared
Original file line number Diff line number Diff line change 1
1
<Project Sdk =" Microsoft.NET.Sdk.Web" >
2
2
3
- <PropertyGroup >
4
- <TargetFramework >netcoreapp3.1</TargetFramework >
5
- </PropertyGroup >
3
+ <PropertyGroup >
4
+ <TargetFramework >netcoreapp3.1</TargetFramework >
5
+ </PropertyGroup >
6
6
7
- <ItemGroup >
8
- <ProjectReference Include =" ..\..\..\src\PeterLeslieMorris.Blazor.FluentValidation\PeterLeslieMorris.Blazor.FluentValidation.csproj" />
9
- <ProjectReference Include =" ..\..\..\src\PeterLeslieMorris.Blazor.Validation\PeterLeslieMorris.Blazor.Validation.csproj" />
10
- </ItemGroup >
7
+ <ItemGroup >
8
+ <ProjectReference Include =" ..\..\..\src\PeterLeslieMorris.Blazor.FluentValidation\PeterLeslieMorris.Blazor.FluentValidation.csproj" />
9
+ <ProjectReference Include =" ..\..\..\src\PeterLeslieMorris.Blazor.Validation\PeterLeslieMorris.Blazor.Validation.csproj" />
10
+ </ItemGroup >
11
11
12
12
</Project >
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ public class PersonValidator : AbstractValidator<Person>
11
11
public PersonValidator ( )
12
12
{
13
13
RuleFor ( x => x . Salutation )
14
- . Cascade ( CascadeMode . StopOnFirstFailure )
14
+ . Cascade ( CascadeMode . Stop )
15
15
. NotEmpty ( )
16
16
. MustAsync ( LongRunningAsyncMethod ) . WithMessage ( "Cannot be DR" ) ;
17
17
RuleFor ( x => x . GivenName ) . NotEmpty ( ) ;
Original file line number Diff line number Diff line change 2
2
3
3
<PropertyGroup >
4
4
5
- <Version >1.6 .0</Version >
6
- <AssemblyVersion >1.6 .0.0</AssemblyVersion >
7
- <FileVersion >1.6 .0.0</FileVersion >
5
+ <Version >1.7 .0</Version >
6
+ <AssemblyVersion >1.7 .0.0</AssemblyVersion >
7
+ <FileVersion >1.7 .0.0</FileVersion >
8
8
9
9
<Authors >Peter Morris</Authors >
10
10
<Company />
Original file line number Diff line number Diff line change 8
8
</PropertyGroup >
9
9
10
10
<ItemGroup >
11
- <PackageReference Include =" FluentValidation" Version =" 9 .0.1 " />
11
+ <PackageReference Include =" FluentValidation" Version =" 10 .0.4 " />
12
12
</ItemGroup >
13
13
14
14
<ItemGroup >
You can’t perform that action at this time.
0 commit comments