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.
4747 - [ FluentValidation Sample] - Shows how to use the [ FluentValidation.com] library to validate.
4848
4949## 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+
5058### New in 1.5.0
5159- Support .NET 5.0
5260
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 >
810</Router >
Original file line number Diff line number Diff line change 66 </PropertyGroup >
77
88 <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" />
1312 </ItemGroup >
1413
1514 <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 ;
27
38namespace DataAnnotationsValidationSample
49{
510 public class Program
611 {
7- public static void Main ( string [ ] args )
12+ public static async Task Main ( string [ ] args )
813 {
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 ( ) ) ;
1119
12- public static IWebAssemblyHostBuilder CreateHostBuilder ( string [ ] args ) =>
13- BlazorWebAssemblyHost . CreateDefaultBuilder ( )
14- . UseBlazorStartup < Startup > ( ) ;
20+ await builder . Build ( ) . RunAsync ( ) ;
21+ }
1522 }
1623}
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 55@using Microsoft .JSInterop
66@using DataAnnotationsValidationSample
77@using DataAnnotationsValidationSample .Components
8- @using DataAnnotationsValidationSample .Shared
8+ @using DataAnnotationsValidationSample .Shared
Original file line number Diff line number Diff line change 11<Project Sdk =" Microsoft.NET.Sdk.Web" >
22
3- <PropertyGroup >
4- <TargetFramework >netcoreapp3.1</TargetFramework >
5- </PropertyGroup >
3+ <PropertyGroup >
4+ <TargetFramework >netcoreapp3.1</TargetFramework >
5+ </PropertyGroup >
66
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 >
1111
1212</Project >
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ public class PersonValidator : AbstractValidator<Person>
1111 public PersonValidator ( )
1212 {
1313 RuleFor ( x => x . Salutation )
14- . Cascade ( CascadeMode . StopOnFirstFailure )
14+ . Cascade ( CascadeMode . Stop )
1515 . NotEmpty ( )
1616 . MustAsync ( LongRunningAsyncMethod ) . WithMessage ( "Cannot be DR" ) ;
1717 RuleFor ( x => x . GivenName ) . NotEmpty ( ) ;
Original file line number Diff line number Diff line change 22
33 <PropertyGroup >
44
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 >
88
99 <Authors >Peter Morris</Authors >
1010 <Company />
Original file line number Diff line number Diff line change 88 </PropertyGroup >
99
1010 <ItemGroup >
11- <PackageReference Include =" FluentValidation" Version =" 9 .0.1 " />
11+ <PackageReference Include =" FluentValidation" Version =" 10 .0.4 " />
1212 </ItemGroup >
1313
1414 <ItemGroup >
You can’t perform that action at this time.
0 commit comments