wildcard search
This commit is contained in:
@@ -9,22 +9,20 @@
|
||||
|
||||
using System;
|
||||
|
||||
internal class ServiceProvider
|
||||
internal static class ServiceProvider
|
||||
{
|
||||
private static IServiceProvider serviceProvider;
|
||||
|
||||
internal static T GetService<T>()
|
||||
=> serviceProvider.GetService<T>();
|
||||
|
||||
internal static void RegisterServices(string sqlConnectionString)
|
||||
{
|
||||
serviceProvider = new ServiceCollection()
|
||||
internal static void RegisterInternalServices(string sqlConnectionString)
|
||||
=> serviceProvider = new ServiceCollection()
|
||||
.AddSingleton(_ => SQLConnection.CreateConnection(sqlConnectionString))
|
||||
.AddScoped<IEmployeesRepository, EmployeesRepository>()
|
||||
.AddScoped<IFunctionsRepository, FunctionsRepository>()
|
||||
.AddScoped<IRolesRepository, RolesRepository>()
|
||||
.AddScoped<ISoftwareRepository, SoftwareRepository>()
|
||||
.BuildServiceProvider();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user