Make toolshed stuff oneOff IoC injections.

Removes a ton of IoC injector delegates.
This commit is contained in:
Pieter-Jan Briers
2023-08-29 21:56:57 +02:00
parent d78f378493
commit 5eed3bc281
2 changed files with 3 additions and 3 deletions

View File

@@ -77,7 +77,7 @@ public sealed class ToolshedEnvironment
}
var command = (ToolshedCommand)Activator.CreateInstance(ty)!;
IoCManager.InjectDependencies(command);
IoCManager.Resolve<IDependencyCollection>().InjectDependencies(command, oneOff: true);
_commands.Add(command.Name, command);
}
@@ -106,7 +106,7 @@ public sealed class ToolshedEnvironment
}
var command = (ToolshedCommand)Activator.CreateInstance(ty)!;
IoCManager.InjectDependencies(command);
IoCManager.Resolve<IDependencyCollection>().InjectDependencies(command, oneOff: true);
_commands.Add(command.Name, command);
}

View File

@@ -42,7 +42,7 @@ public sealed partial class ToolshedManager
}
else
{
var parser = (ITypeParser) _typeFactory.CreateInstanceUnchecked(parserType);
var parser = (ITypeParser) _typeFactory.CreateInstanceUnchecked(parserType, oneOff: true);
parser.PostInject();
_log.Info($"Setting up {parserType.PrettyName()}, {parser.Parses.PrettyName()}");
_consoleTypeParsers.Add(parser.Parses, parser);