Changes to TenantData

This commit is contained in:
Janus C. H. Knudsen 2025-01-16 14:27:05 +01:00
parent fcffb57ac6
commit c10de11bbe
6 changed files with 196 additions and 145 deletions

View file

@ -3,20 +3,19 @@ using Npgsql;
using System.Data;
namespace Core.ModuleRegistry
{
public class DbPostgreSqlModule : Module
{
public string ConnectionString { get; set; }
protected override void Load(ContainerBuilder builder)
{
public class DbPostgreSqlModule : Module
{
public required string ConnectionString { get; set; }
protected override void Load(ContainerBuilder builder)
{
builder.Register(c =>
{
IDbConnection connection = new NpgsqlConnection(ConnectionString);
return connection;
})
.InstancePerLifetimeScope();
builder.Register(c =>
{
IDbConnection connection = new NpgsqlConnection(ConnectionString);
return connection;
})
.InstancePerLifetimeScope();
//builder.RegisterType<IDbConnection>().As<IDbConnection>().InstancePerLifetimeScope();
}
}
}
}
}