|
|
@ -24,11 +24,11 @@ public class AbpFluentValidationConventionalRegistrar : DefaultConventionalRegis |
|
|
{ |
|
|
{ |
|
|
return new List<Type>() |
|
|
return new List<Type>() |
|
|
{ |
|
|
{ |
|
|
typeof(IValidator<>).MakeGenericType(GetFirstGenericArgumentOrNull(type, 1)) |
|
|
typeof(IValidator<>).MakeGenericType(GetFirstGenericArgumentOrNull(type, 1)!) |
|
|
}; |
|
|
}; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private static Type GetFirstGenericArgumentOrNull(Type type, int depth) |
|
|
private static Type? GetFirstGenericArgumentOrNull(Type type, int depth) |
|
|
{ |
|
|
{ |
|
|
const int maxFindDepth = 8; |
|
|
const int maxFindDepth = 8; |
|
|
|
|
|
|
|
|
@ -42,6 +42,6 @@ public class AbpFluentValidationConventionalRegistrar : DefaultConventionalRegis |
|
|
return type.GetGenericArguments()[0]; |
|
|
return type.GetGenericArguments()[0]; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
return GetFirstGenericArgumentOrNull(type.BaseType, depth + 1); |
|
|
return GetFirstGenericArgumentOrNull(type.BaseType!, depth + 1); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|