Change ioc setting to Singleton for LiteDbProvider

This commit is contained in:
Sébastien André
2019-11-12 22:24:42 +01:00
parent 83e9126a5d
commit 35bfdc2183
6 changed files with 12 additions and 43 deletions

View File

@@ -32,7 +32,7 @@ namespace skydiveLogs_api.Ioc
_services.AddScoped<Data.Interface.IGearRepository, Data.GearRepository>();
string connectionString = _configuration.GetConnectionString("DefaultConnection");
_services.AddScoped<Data.Interface.IDataProvider>(c => new Data.LiteDbProvider(connectionString));
_services.AddSingleton<Data.Interface.IDataProvider>(c => new Data.LiteDbProvider(connectionString));
}
private readonly IServiceCollection _services;