CS2-125: Added newly created dto validators in DependencyInjection

This commit is contained in:
Харченко Владимир 2022-01-12 17:35:14 +05:00
parent 9792fe2196
commit d1440ea0d0
2 changed files with 19 additions and 3 deletions

View File

@ -79,6 +79,8 @@ namespace AsbCloudInfrastructure
services.AddTransient<ITelemetryDataService<TelemetryDataSaubDto>, TelemetryDataSaubService>();
services.AddTransient<ITelemetryDataService<TelemetryDataSpinDto>, TelemetryDataSpinService>();
services.AddValidators();
return services;
}

View File

@ -7,11 +7,25 @@ namespace AsbCloudInfrastructure.Validators
{
public static class DependencyInjection
{
public static IServiceCollection AddValidators(this IServiceCollection services,
IConfiguration configuration)
public static IServiceCollection AddValidators(this IServiceCollection services)
{
services.AddTransient<IValidator<AuthDto>, AuthDtoValidator>();
services.AddTransient<IValidator<ClusterDto>, ClusterDtoValidator>();
services.AddTransient<IValidator<CompanyDto>, CompanyDtoValidator>();
services.AddTransient<IValidator<DepositDto>, DepositDtoValidator>();
services.AddTransient<IValidator<DrillFlowChartDto>, DrillFlowChartDtoValidator>();
services.AddTransient<IValidator<EventDto>, EventDtoValidator>();
services.AddTransient<IValidator<FileInfoDto>, FileInfoDtoValidator>();
services.AddTransient<IValidator<FileMarkDto>, FileMarkDtoValidator>();
services.AddTransient<IValidator<MeasureDto>, MeasureDtoValidator>();
services.AddTransient<IValidator<MessageDto>, MessageDtoValidator>();
services.AddTransient<IValidator<PermissionDto>, PermissionDtoValidator>();
services.AddTransient<IValidator<ReportPropertiesDto>, ReportPropertiesDtoValidator>();
services.AddTransient<IValidator<UserRegistrationDto>, UserRegistrationDtoValidator>();
services.AddTransient<IValidator<UserRoleDto>, UserRoleDtoValidator>();
services.AddTransient<IValidator<WellDto>, WellDtoValidator>();
services.AddTransient<IValidator<WellOperationDto>, WellOperationDtoValidator>();
return services;
}
}