0
castellazzi created
- ABP Framework version: v9.0.0
- UI Type: Blazor Server
- Database System: EF Core (SQL Server .)
I have a question about FluentValidation in Blazor server. I use it with package Blazorise.FluentValditation, and also adding Volo.Abp.FluentValidation. I notice 2 problem:
- message from validator is not from abp.validation
- name of field using in message is the property name.
I fix the property using WithName method on method, for the message is need to fix it with WithMessage method?
This is an example:
There are a best pratice for using with Abp and FluentValidation and blazorise?
Many thanks
Marco
2 Answer(s)
-
0
It works for me
- create a new project with blazor-server
- install
Blazorise.FluentValidationandFluentValidation.DependencyInjectionExtensionsto Blazor project - install
Volo.Abp.FluentValidationto Application project
Configure
[DependsOn( ...... typeof(AbpFluentValidationModule) )] public class TestappApplicationModule : AbpModulecontext.Services .AddBootstrap5Providers() .AddFontAwesomeIcons() .AddBlazoriseFluentValidation(); context.Services.AddValidatorsFromAssembly(typeof(TestappApplicationModule).Assembly);name of field using in message is the property name. I fix the property using WithName method on method, for the message is need to fix it with WithMessage method? This is an example:
You have to use
WithName -
0
Ok. Ii's work also for me. Thanks,
