Adds code

This commit is contained in:
Janus Knudsen 2025-01-03 16:21:03 +00:00 committed by Janus C. H. Knudsen
commit 269bf50c78
33 changed files with 1489 additions and 0 deletions

View file

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