Skip to content

Commit 065e286

Browse files
committed
Deprecate various older validator registration methods
1 parent 3db6627 commit 065e286

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/FluentValidation.AspNetCore/FluentValidation.AspNetCore.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<TargetFrameworks>netcoreapp3.1;net5.0;net6.0</TargetFrameworks>
4-
<VersionPrefix>11.2.0</VersionPrefix>
4+
<VersionPrefix>11.2.1</VersionPrefix>
55
<AssemblyName>FluentValidation.AspNetCore</AssemblyName>
66
<PackageId>FluentValidation.AspNetCore</PackageId>
77
<Product>FluentValidation.AspNetCore</Product>

src/FluentValidation.AspNetCore/FluentValidationMvcConfiguration.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ public bool LocalizationEnabled {
111111
/// <param name="filter">Optional filter that allows certain types to be skipped from registration.</param>
112112
/// <param name="lifetime">The service lifetime that should be used for the validator registration. Defaults to Scoped</param>
113113
/// <param name="includeInternalTypes">Include internal validators. The default is false.</param>
114-
// [Obsolete("RegisterValidatorsFromAssemblyContaining is deprecated. Call services.AddValidatorsFromAssemblyContaining<T> instead, which has the same effect. See https://github.com/FluentValidation/FluentValidation/issues/1963")]
114+
[Obsolete("RegisterValidatorsFromAssemblyContaining is deprecated. Call services.AddValidatorsFromAssemblyContaining<T> instead, which has the same effect. See https://github.com/FluentValidation/FluentValidation/issues/1963")]
115115
public FluentValidationMvcConfiguration RegisterValidatorsFromAssemblyContaining<T>(Func<AssemblyScanner.AssemblyScanResult, bool> filter = null, ServiceLifetime lifetime = ServiceLifetime.Scoped, bool includeInternalTypes = false) {
116116
return RegisterValidatorsFromAssemblyContaining(typeof(T), filter, lifetime, includeInternalTypes);
117117
}
@@ -123,7 +123,7 @@ public FluentValidationMvcConfiguration RegisterValidatorsFromAssemblyContaining
123123
/// <param name="filter">Optional filter that allows certain types to be skipped from registration.</param>
124124
/// <param name="lifetime">The service lifetime that should be used for the validator registration. Defaults to Scoped</param>
125125
/// <param name="includeInternalTypes">Include internal validators. The default is false.</param>
126-
// [Obsolete("RegisterValidatorsFromAssemblyContaining is deprecated. Call services.AddValidatorsFromAssemblyContaining instead, which has the same effect. See https://github.com/FluentValidation/FluentValidation/issues/1963")]
126+
[Obsolete("RegisterValidatorsFromAssemblyContaining is deprecated. Call services.AddValidatorsFromAssemblyContaining instead, which has the same effect. See https://github.com/FluentValidation/FluentValidation/issues/1963")]
127127
public FluentValidationMvcConfiguration RegisterValidatorsFromAssemblyContaining(Type type, Func<AssemblyScanner.AssemblyScanResult, bool> filter = null, ServiceLifetime lifetime = ServiceLifetime.Scoped, bool includeInternalTypes = false) {
128128
return RegisterValidatorsFromAssembly(type.Assembly, filter, lifetime, includeInternalTypes);
129129
}
@@ -135,7 +135,7 @@ public FluentValidationMvcConfiguration RegisterValidatorsFromAssemblyContaining
135135
/// <param name="filter">Optional filter that allows certain types to be skipped from registration.</param>
136136
/// <param name="lifetime">The service lifetime that should be used for the validator registration. Defaults to Scoped</param>
137137
/// <param name="includeInternalTypes">Include internal validators. The default is false.</param>
138-
// [Obsolete("RegisterValidatorsFromAssembly is deprecated. Call services.AddValidatorsFromAssembly instead, which has the same effect. See https://github.com/FluentValidation/FluentValidation/issues/1963")]
138+
[Obsolete("RegisterValidatorsFromAssembly is deprecated. Call services.AddValidatorsFromAssembly instead, which has the same effect. See https://github.com/FluentValidation/FluentValidation/issues/1963")]
139139
public FluentValidationMvcConfiguration RegisterValidatorsFromAssembly(Assembly assembly, Func<AssemblyScanner.AssemblyScanResult, bool> filter = null, ServiceLifetime lifetime = ServiceLifetime.Scoped, bool includeInternalTypes = false) {
140140
_services.AddValidatorsFromAssembly(assembly, lifetime, filter, includeInternalTypes);
141141

@@ -152,7 +152,7 @@ public FluentValidationMvcConfiguration RegisterValidatorsFromAssembly(Assembly
152152
/// <param name="filter">Optional filter that allows certain types to be skipped from registration.</param>
153153
/// <param name="lifetime">The service lifetime that should be used for the validator registration. Defaults to Scoped</param>
154154
/// <param name="includeInternalTypes">Include internal validators. The default is false.</param>
155-
// [Obsolete("RegisterValidatorsFromAssemblies is deprecated. Call services.AddValidatorsFromAssemblies instead, which has the same effect. See https://github.com/FluentValidation/FluentValidation/issues/1963")]
155+
[Obsolete("RegisterValidatorsFromAssemblies is deprecated. Call services.AddValidatorsFromAssemblies instead, which has the same effect. See https://github.com/FluentValidation/FluentValidation/issues/1963")]
156156
public FluentValidationMvcConfiguration RegisterValidatorsFromAssemblies(IEnumerable<Assembly> assemblies, Func<AssemblyScanner.AssemblyScanResult, bool> filter = null, ServiceLifetime lifetime = ServiceLifetime.Scoped, bool includeInternalTypes = false) {
157157
_services.AddValidatorsFromAssemblies(assemblies, lifetime, filter, includeInternalTypes);
158158

0 commit comments

Comments
 (0)