Skip to content

Commit 69ddc73

Browse files
Code smells
1 parent f8a793b commit 69ddc73

3 files changed

Lines changed: 8 additions & 24 deletions

File tree

src/Dotnet5.GraphQL3.CrossCutting/Extensions/LocalAssemblyExtensions.cs

Lines changed: 0 additions & 10 deletions
This file was deleted.

src/Dotnet5.GraphQL3.Domain.Abstractions/Extensions/DependencyInjection/ServiceCollectionExtensions.cs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using Dotnet5.GraphQL3.CrossCutting.Extensions;
1+
using Dotnet5.GraphQL3.CrossCutting;
22
using Dotnet5.GraphQL3.Domain.Abstractions.Builders;
33
using Microsoft.Extensions.DependencyInjection;
44
using Scrutor;
@@ -8,12 +8,9 @@ namespace Dotnet5.GraphQL3.Domain.Abstractions.Extensions.DependencyInjection
88
public static class ServiceCollectionExtensions
99
{
1010
public static IServiceCollection AddBuilders(this IServiceCollection services)
11-
=> services.Scan(selector
12-
=> selector
13-
.FromApplicationDependencies(assembly
14-
=> assembly.FullName?.StartsWith(assembly.GetEntryAssemblySuffix()) ?? default)
15-
.AddClasses(filter
16-
=> filter.AssignableTo(typeof(IBuilder<,>)))
11+
=> services
12+
.Scan(selector => selector.FromAssemblies(Application.Assemblies)
13+
.AddClasses(filter => filter.AssignableTo(typeof(IBuilder<,>)))
1714
.UsingRegistrationStrategy(RegistrationStrategy.Skip)
1815
.AsImplementedInterfaces()
1916
.WithScopedLifetime());

src/Dotnet5.GraphQL3.Repositories.Abstractions/Extensions/DependencyInjection/ServiceCollectionExtensions.cs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using Dotnet5.GraphQL3.CrossCutting.Extensions;
1+
using Dotnet5.GraphQL3.CrossCutting;
22
using Dotnet5.GraphQL3.Repositories.Abstractions.UnitsOfWork;
33
using Microsoft.Extensions.DependencyInjection;
44
using Scrutor;
@@ -8,12 +8,9 @@ namespace Dotnet5.GraphQL3.Repositories.Abstractions.Extensions.DependencyInject
88
public static class ServiceCollectionExtensions
99
{
1010
public static IServiceCollection AddRepositories(this IServiceCollection services)
11-
=> services.Scan(selector
12-
=> selector
13-
.FromApplicationDependencies(assembly
14-
=> assembly.FullName?.StartsWith(assembly.GetEntryAssemblySuffix()) ?? default)
15-
.AddClasses(filter
16-
=> filter.AssignableTo(typeof(IRepository<,>)))
11+
=> services
12+
.Scan(selector => selector.FromAssemblies(Application.Assemblies)
13+
.AddClasses(filter => filter.AssignableTo(typeof(IRepository<,>)))
1714
.UsingRegistrationStrategy(RegistrationStrategy.Skip)
1815
.AsImplementedInterfaces()
1916
.WithScopedLifetime());

0 commit comments

Comments
 (0)