Fix up tooling to handle new types in DI (#434)
* Fix up tooling to handle new types in DI * Remove usings
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using SPTarkov.DI;
|
||||
using SPTarkov.Server.Core.Models.Spt.Mod;
|
||||
using SPTarkov.Server.Core.Utils;
|
||||
|
||||
namespace HideoutCraftQuestIdGenerator;
|
||||
@@ -10,7 +12,11 @@ public class HideoutCraftQuestIdGeneratorLauncher
|
||||
{
|
||||
try
|
||||
{
|
||||
ProgramStatics.Initialize();
|
||||
|
||||
var serviceCollection = new ServiceCollection();
|
||||
serviceCollection.AddSingleton(WebApplication.CreateBuilder());
|
||||
serviceCollection.AddSingleton<IReadOnlyList<SptMod>>([]);
|
||||
var diHandler = new DependencyInjectionHandler(serviceCollection);
|
||||
diHandler.AddInjectableTypesFromTypeAssembly(
|
||||
typeof(HideoutCraftQuestIdGeneratorLauncher)
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using SPTarkov.DI;
|
||||
using SPTarkov.Server.Core.Models.Spt.Mod;
|
||||
using SPTarkov.Server.Core.Utils;
|
||||
@@ -11,12 +12,13 @@ public class ItemTplGeneratorLauncher
|
||||
{
|
||||
try
|
||||
{
|
||||
ProgramStatics.Initialize();
|
||||
|
||||
var serviceCollection = new ServiceCollection();
|
||||
serviceCollection.AddSingleton(WebApplication.CreateBuilder());
|
||||
serviceCollection.AddSingleton<IReadOnlyList<SptMod>>([]);
|
||||
var diHandler = new DependencyInjectionHandler(serviceCollection);
|
||||
|
||||
diHandler.AddTypeNamesToIgnore(["HttpServer", "HttpCallbacks"]);
|
||||
|
||||
diHandler.AddInjectableTypesFromTypeAssembly(typeof(ItemTplGeneratorLauncher));
|
||||
diHandler.AddInjectableTypesFromTypeAssembly(typeof(App));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user