Skip to content

Commit

Permalink
Deprecate various older validator registration methods
Browse files Browse the repository at this point in the history
  • Loading branch information
JeremySkinner committed Aug 9, 2022
1 parent 3db6627 commit 065e286
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netcoreapp3.1;net5.0;net6.0</TargetFrameworks>
<VersionPrefix>11.2.0</VersionPrefix>
<VersionPrefix>11.2.1</VersionPrefix>
<AssemblyName>FluentValidation.AspNetCore</AssemblyName>
<PackageId>FluentValidation.AspNetCore</PackageId>
<Product>FluentValidation.AspNetCore</Product>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public bool LocalizationEnabled {
/// <param name="filter">Optional filter that allows certain types to be skipped from registration.</param>
/// <param name="lifetime">The service lifetime that should be used for the validator registration. Defaults to Scoped</param>
/// <param name="includeInternalTypes">Include internal validators. The default is false.</param>
// [Obsolete("RegisterValidatorsFromAssemblyContaining is deprecated. Call services.AddValidatorsFromAssemblyContaining<T> instead, which has the same effect. See https://github.com/FluentValidation/FluentValidation/issues/1963")]
[Obsolete("RegisterValidatorsFromAssemblyContaining is deprecated. Call services.AddValidatorsFromAssemblyContaining<T> instead, which has the same effect. See https://github.com/FluentValidation/FluentValidation/issues/1963")]
public FluentValidationMvcConfiguration RegisterValidatorsFromAssemblyContaining<T>(Func<AssemblyScanner.AssemblyScanResult, bool> filter = null, ServiceLifetime lifetime = ServiceLifetime.Scoped, bool includeInternalTypes = false) {
return RegisterValidatorsFromAssemblyContaining(typeof(T), filter, lifetime, includeInternalTypes);
}
Expand All @@ -123,7 +123,7 @@ public FluentValidationMvcConfiguration RegisterValidatorsFromAssemblyContaining
/// <param name="filter">Optional filter that allows certain types to be skipped from registration.</param>
/// <param name="lifetime">The service lifetime that should be used for the validator registration. Defaults to Scoped</param>
/// <param name="includeInternalTypes">Include internal validators. The default is false.</param>
// [Obsolete("RegisterValidatorsFromAssemblyContaining is deprecated. Call services.AddValidatorsFromAssemblyContaining instead, which has the same effect. See https://github.com/FluentValidation/FluentValidation/issues/1963")]
[Obsolete("RegisterValidatorsFromAssemblyContaining is deprecated. Call services.AddValidatorsFromAssemblyContaining instead, which has the same effect. See https://github.com/FluentValidation/FluentValidation/issues/1963")]
public FluentValidationMvcConfiguration RegisterValidatorsFromAssemblyContaining(Type type, Func<AssemblyScanner.AssemblyScanResult, bool> filter = null, ServiceLifetime lifetime = ServiceLifetime.Scoped, bool includeInternalTypes = false) {
return RegisterValidatorsFromAssembly(type.Assembly, filter, lifetime, includeInternalTypes);
}
Expand All @@ -135,7 +135,7 @@ public FluentValidationMvcConfiguration RegisterValidatorsFromAssemblyContaining
/// <param name="filter">Optional filter that allows certain types to be skipped from registration.</param>
/// <param name="lifetime">The service lifetime that should be used for the validator registration. Defaults to Scoped</param>
/// <param name="includeInternalTypes">Include internal validators. The default is false.</param>
// [Obsolete("RegisterValidatorsFromAssembly is deprecated. Call services.AddValidatorsFromAssembly instead, which has the same effect. See https://github.com/FluentValidation/FluentValidation/issues/1963")]
[Obsolete("RegisterValidatorsFromAssembly is deprecated. Call services.AddValidatorsFromAssembly instead, which has the same effect. See https://github.com/FluentValidation/FluentValidation/issues/1963")]
public FluentValidationMvcConfiguration RegisterValidatorsFromAssembly(Assembly assembly, Func<AssemblyScanner.AssemblyScanResult, bool> filter = null, ServiceLifetime lifetime = ServiceLifetime.Scoped, bool includeInternalTypes = false) {
_services.AddValidatorsFromAssembly(assembly, lifetime, filter, includeInternalTypes);

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

Expand Down

0 comments on commit 065e286

Please sign in to comment.