- Notifications
You must be signed in to change notification settings - Fork27
Validation extensions for Microsoft Blazor / FluentValidation
License
mrpmorris/blazor-validation
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Blazor-Validation is a validation agnostic library for validating forms in Blazor-Microsoft aspdotnet Blazor project.
You can download the latest release / pre-release NuGet packages from the official NuGet pages:
- Add a reference to Morris.Blazor.Validation
- Inside the
<EditForm>
in your razor files, add<Morris.Blazor.Validation.Validate/>
- In startup.cs add
using Morris.Blazor.Validation
and then add the relevant validation in theConfigureServices
method.
services.AddFormValidation(config => config.AddDataAnnotationsValidation());
services.AddFormValidation(config => config.AddFluentValidation(typeof(SomeValidator).Assembly));
It is possible to add as many validation providers as you wish
services.AddFormValidation(config=>config.AddDataAnnotationsValidation().AddFluentValidation(typeof(SomeValidator).Assembly));
Also you can have theFluentValidation
extension scan multiple assemblies
services.AddFormValidation(config=>config.AddFluentValidation(typeof(SomeValidator).Assembly,typeof(ClassInAnotherDll).Assembly,andAnotherAssembly,andYetAnotherAssembly));
The standard Blazor components<ValidationSummary>
and<ValidationMessage>
will now work with your selected validation options.
More sample projects will be added as the framework develops.
- Data Annotations Sample- Shows how to use DataAnnotations to validate.
- FluentValidation Sample- Shows how to use the [FluentValidation.com] library to validate.
- Support for .net 8 and 9 only
- Support for .Net 8
- Add OnTransformModel delegate to allow the model to be transformed before validation (This is useful when using endpoint-centric APIs)
- Major change because it changes the signature of the public IValidationProvider interface.
- Add net7.0 target framework.
- Use
Services.TryAddScoped
instead ofServices.AddScoped
for validators, in casethe consuming app has already registered validators with a different lifetime.
- Upgrade to FluentValidation V10
- Prevent ValidateObjectTree from visiting struct propertiesBug #33
- Suport FluentValidation's RuleForEach and ChildRules
- Support .NET 5.0
- Upgrade to FluentValidation 9
- Add new EditContext.ValidateProperties for validating sub-sets of an object
- Return
bool
from EditContext.ValidateProperty
- Updated FluentValidationSample
- First major release
- Remove old EditContextExtensions file
- Ensure strings are not enumerated when traversing a whole object tree to validate
- Upgraded to .NETCore 3
- Upgraded to Blazor RC1
- Added an
EditContext.ValidateObjectTree
- Upgraded to Blazor Preview 9
- Fixed bug in FluentValidation that prevented objects with complex property types from being validated
- Upgraded to Blazor Preview 8
- Upgraded to Blazor Preview 7
- Initial public release
About
Validation extensions for Microsoft Blazor / FluentValidation
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Contributors4
Uh oh!
There was an error while loading.Please reload this page.