Refactor code formatting and improve readability: standardize line breaks and indentation across various endpoint files, enhancing code clarity and maintainability. Update package version formatting in Directory.Packages.props for consistency.
This commit is contained in:
@@ -29,13 +29,20 @@ public static class DependencyInjection
|
||||
return services;
|
||||
}
|
||||
|
||||
private static void RegisterClosedGeneric(IServiceCollection services, Assembly assembly, Type openInterface)
|
||||
private static void RegisterClosedGeneric(
|
||||
IServiceCollection services,
|
||||
Assembly assembly,
|
||||
Type openInterface
|
||||
)
|
||||
{
|
||||
var implementations = assembly.GetTypes()
|
||||
var implementations = assembly
|
||||
.GetTypes()
|
||||
.Where(t => t is { IsClass: true, IsAbstract: false })
|
||||
.SelectMany(t => t.GetInterfaces()
|
||||
.Where(i => i.IsGenericType && i.GetGenericTypeDefinition() == openInterface)
|
||||
.Select(i => (Service: i, Implementation: t)));
|
||||
.SelectMany(t =>
|
||||
t.GetInterfaces()
|
||||
.Where(i => i.IsGenericType && i.GetGenericTypeDefinition() == openInterface)
|
||||
.Select(i => (Service: i, Implementation: t))
|
||||
);
|
||||
|
||||
foreach (var (service, implementation) in implementations)
|
||||
services.AddScoped(service, implementation);
|
||||
|
||||
Reference in New Issue
Block a user