Application User setup WIP
This commit is contained in:
parent
c83442b4af
commit
cb6dd39596
16 changed files with 362 additions and 314 deletions
22
Database/ModuleRegistry/DbPostgreSqlModule.cs
Normal file
22
Database/ModuleRegistry/DbPostgreSqlModule.cs
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
using Autofac;
|
||||
using Npgsql;
|
||||
using System.Data;
|
||||
namespace Database.ModuleRegistry
|
||||
{
|
||||
public class DbPostgreSqlModule : Module
|
||||
{
|
||||
public required string ConnectionString { get; set; }
|
||||
protected override void Load(ContainerBuilder builder)
|
||||
{
|
||||
Insight.Database.Providers.PostgreSQL.PostgreSQLInsightDbProvider.RegisterProvider();
|
||||
|
||||
builder.Register(c =>
|
||||
{
|
||||
IDbConnection connection = new NpgsqlConnection(ConnectionString);
|
||||
return connection;
|
||||
})
|
||||
.InstancePerLifetimeScope();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue