Skip to content

Commit

Permalink
Add includeInternalTypes parameter #18
Browse files Browse the repository at this point in the history
  • Loading branch information
GetoXs committed Nov 19, 2023
1 parent 7ddb5bd commit f1f3116
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="FluentValidation" Version="11.7.1" />
<PackageReference Include="FluentValidation" Version="11.8.0" />
<PackageReference Include="MediatR" Version="12.1.1" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="6.0.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<PackageReadmeFile>README.md</PackageReadmeFile>
<DebugType>embedded</DebugType>
<Configurations>Debug;Release;SignAndRelease</Configurations>
<Version>5.0.0</Version>
<Version>5.1.0</Version>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)' == 'SignAndRelease'">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@ public static IServiceCollection AddFluentValidation(
this IServiceCollection services,
IEnumerable<Assembly> assemblies,
ServiceLifetime lifetime = ServiceLifetime.Transient,
Func<AssemblyScanner.AssemblyScanResult, bool> filter = null
Func<AssemblyScanner.AssemblyScanResult, bool> filter = null,
bool includeInternalTypes = false
)
{
services.Add(new ServiceDescriptor(typeof(IPipelineBehavior<,>), typeof(ValidationBehavior<,>), lifetime));

services.AddValidatorsFromAssemblies(assemblies, lifetime, filter);
services.AddValidatorsFromAssemblies(assemblies, lifetime, filter, includeInternalTypes);

return services;
}
Expand Down

0 comments on commit f1f3116

Please sign in to comment.