Skip to content

Commit 3f17fe3

Browse files
chore: this commit moves fluent validation aspnet auto validation to the webapi layer instead of infra.ioc because the webapi layer is more appropriate for this service
1 parent 0a328ec commit 3f17fe3

2 files changed

Lines changed: 4 additions & 5 deletions

File tree

Source/HttpsRichardy.Federation.Infrastructure.IoC/Extensions/ValidationExtension.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,6 @@ public static class ValidationExtension
55
{
66
public static void AddValidators(this IServiceCollection services)
77
{
8-
services.AddFluentValidationAutoValidation(options =>
9-
{
10-
options.DisableDataAnnotationsValidation = true;
11-
});
12-
138
services.AddTransient<IValidator<AuthenticationCredentials>, AuthenticationCredentialsValidator>();
149
services.AddTransient<IValidator<AuthorizationParameters>, AuthorizationParametersValidator>();
1510
services.AddTransient<IValidator<ClientAuthenticationCredentials>, ClientAuthenticationCredentialsValidator>();

Source/HttpsRichardy.Federation.WebApi/Extensions/WebInfrastructureExtension.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,9 @@ public static void AddWebComposition(this IServiceCollection services, IWebHostE
1414
services.AddProviders();
1515
services.AddOpenApiSpecification();
1616
services.AddRazorPages();
17+
services.AddFluentValidationAutoValidation(options =>
18+
{
19+
options.DisableDataAnnotationsValidation = true;
20+
});
1721
}
1822
}

0 commit comments

Comments
 (0)