Revert "Removed variable assignment"

This reverts commit 5dad4dbe84ecce6bbafbede8169b0bbe8fda61a2.
This commit is contained in:
Chomp
2025-02-02 11:40:46 +00:00
parent f1fb9b57a0
commit ccc7f612e2
@@ -19,10 +19,11 @@ public static class DependencyInjectionRegistrator
public static void RegisterComponents(IServiceCollection builderServices, IEnumerable<Type> types)
{
var groupedTypes = types.SelectMany(
registerableType =>
t =>
{
var attributes = (Injectable[])Attribute.GetCustomAttributes(registerableType, typeof(Injectable));
var registerableComponentsResult = new List<RegisterableType>();
var attributes = (Injectable[])Attribute.GetCustomAttributes(t, typeof(Injectable));
var registerableType = t;
var registerableComponents = new List<RegisterableType>();
foreach (var attribute in attributes)
{
// if we have a type override this takes priority
@@ -36,10 +37,10 @@ public static class DependencyInjectionRegistrator
registerableType = registerableType.GetInterfaces()[0];
}
registerableComponentsResult.Add(new RegisterableType(registerableType, registerableType, attribute));
registerableComponents.Add(new RegisterableType(registerableType, t, attribute));
}
return registerableComponentsResult;
return registerableComponents;
}
)
.GroupBy(t => t.RegisterableInterface.FullName);