DI completely reworked to keep status of singletons on multi type components
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
using SPTarkov.Common.Annotations;
|
||||
using SPTarkov.DI.Annotations;
|
||||
using SPTarkov.Server.Core.DI;
|
||||
using SPTarkov.Server.Core.Helpers;
|
||||
using SPTarkov.Server.Core.Models.Eft.Common.Tables;
|
||||
|
||||
@@ -11,11 +11,10 @@ public class HideoutCraftQuestIdGeneratorLauncher
|
||||
try
|
||||
{
|
||||
var serviceCollection = new ServiceCollection();
|
||||
DependencyInjectionRegistrator.RegisterSptComponents(
|
||||
typeof(HideoutCraftQuestIdGeneratorLauncher).Assembly,
|
||||
typeof(App).Assembly,
|
||||
serviceCollection
|
||||
);
|
||||
var diHandler = new DependencyInjectionHandler(serviceCollection);
|
||||
diHandler.AddInjectableTypesFromTypeAssembly(typeof(HideoutCraftQuestIdGeneratorLauncher));
|
||||
diHandler.AddInjectableTypesFromTypeAssembly(typeof(App));
|
||||
diHandler.InjectAll();
|
||||
var serviceProvider = serviceCollection.BuildServiceProvider();
|
||||
serviceProvider.GetService<HideoutCraftQuestIdGenerator>().Run().Wait();
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using SPTarkov.Common.Annotations;
|
||||
using SPTarkov.DI.Annotations;
|
||||
using SPTarkov.Server.Core.Models.Logging;
|
||||
using SPTarkov.Server.Core.Models.Spt.Logging;
|
||||
using SPTarkov.Server.Core.Models.Utils;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
using SPTarkov.Common.Annotations;
|
||||
using SPTarkov.Common.Extensions;
|
||||
using SPTarkov.DI.Annotations;
|
||||
using SPTarkov.Server.Core.Callbacks;
|
||||
using SPTarkov.Server.Core.DI;
|
||||
using SPTarkov.Server.Core.Helpers;
|
||||
|
||||
@@ -11,11 +11,10 @@ public class ItemTplGeneratorLauncher
|
||||
try
|
||||
{
|
||||
var serviceCollection = new ServiceCollection();
|
||||
DependencyInjectionRegistrator.RegisterSptComponents(
|
||||
typeof(ItemTplGeneratorLauncher).Assembly,
|
||||
typeof(App).Assembly,
|
||||
serviceCollection
|
||||
);
|
||||
var diHandler = new DependencyInjectionHandler(serviceCollection);
|
||||
diHandler.AddInjectableTypesFromTypeAssembly(typeof(ItemTplGeneratorLauncher));
|
||||
diHandler.AddInjectableTypesFromTypeAssembly(typeof(App));
|
||||
diHandler.InjectAll();
|
||||
var serviceProvider = serviceCollection.BuildServiceProvider();
|
||||
serviceProvider.GetService<ItemTplGenerator>().Run().Wait();
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using SPTarkov.Common.Annotations;
|
||||
using SPTarkov.DI.Annotations;
|
||||
using SPTarkov.Server.Core.Models.Logging;
|
||||
using SPTarkov.Server.Core.Models.Spt.Logging;
|
||||
using SPTarkov.Server.Core.Models.Utils;
|
||||
|
||||
Reference in New Issue
Block a user