maliming
3 years ago
No known key found for this signature in database
GPG Key ID: A646B9CB645ECEA4
2 changed files with
12 additions and
0 deletions
-
framework/src/Volo.Abp.FluentValidation/Volo/Abp/FluentValidation/AbpFluentValidationConventionalRegistrar.cs
-
framework/test/Volo.Abp.FluentValidation.Tests/Volo/Abp/FluentValidation/ApplicationService_FluentValidation_Tests.cs
|
|
@ -24,6 +24,7 @@ public class AbpFluentValidationConventionalRegistrar : DefaultConventionalRegis |
|
|
{ |
|
|
{ |
|
|
return new List<Type>() |
|
|
return new List<Type>() |
|
|
{ |
|
|
{ |
|
|
|
|
|
type, |
|
|
typeof(IValidator<>).MakeGenericType(GetFirstGenericArgumentOrNull(type, 1)!) |
|
|
typeof(IValidator<>).MakeGenericType(GetFirstGenericArgumentOrNull(type, 1)!) |
|
|
}; |
|
|
}; |
|
|
} |
|
|
} |
|
|
|
|
|
@ -103,6 +103,17 @@ public class ApplicationService_FluentValidation_Tests : AbpIntegratedTest<Appli |
|
|
output.ShouldBe("444"); |
|
|
output.ShouldBe("444"); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[Fact] |
|
|
|
|
|
public void Should_Add_Validators_To_DI() |
|
|
|
|
|
{ |
|
|
|
|
|
var validator = ServiceProvider.GetService<IValidator<MyMethodInput>>(); |
|
|
|
|
|
validator.GetType().ShouldBe(typeof(MyMethodInputValidator)); |
|
|
|
|
|
|
|
|
|
|
|
validator = ServiceProvider.GetService<MyMethodInputValidator>(); |
|
|
|
|
|
validator.GetType().ShouldBe(typeof(MyMethodInputValidator)); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
[DependsOn(typeof(AbpAutofacModule))] |
|
|
[DependsOn(typeof(AbpAutofacModule))] |
|
|
[DependsOn(typeof(AbpFluentValidationModule))] |
|
|
[DependsOn(typeof(AbpFluentValidationModule))] |
|
|
public class TestModule : AbpModule |
|
|
public class TestModule : AbpModule |
|
|
|