25 lines
765 B
C#
25 lines
765 B
C#
namespace LaaProduction.Search
|
|
{
|
|
using LaaProduction.Search.Data;
|
|
using LaaProduction.Search.Data.Interfaces;
|
|
using LaaProductionSQL;
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
using System;
|
|
|
|
internal static class ServiceProvider
|
|
{
|
|
private static IServiceProvider serviceProvider;
|
|
|
|
internal static T GetService<T>()
|
|
=> serviceProvider.GetService<T>();
|
|
|
|
internal static void RegisterInternalServices(string sqlConnectionString)
|
|
=> serviceProvider = new ServiceCollection()
|
|
.AddSingleton(_ => SQLConnection.CreateConnection(sqlConnectionString))
|
|
.AddScoped<IWildcardRepository, WildcardRepository>()
|
|
.BuildServiceProvider();
|
|
}
|
|
}
|