Initial commit: SWP.Core enterprise framework with multi-tenant architecture, configuration management, security, telemetry and comprehensive test suite
This commit is contained in:
commit
5275a75502
87 changed files with 6140 additions and 0 deletions
26
Database/ModuleRegistry/DbPostgreSqlModule.cs
Normal file
26
Database/ModuleRegistry/DbPostgreSqlModule.cs
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
using Autofac;
|
||||
using PlanTempus.Core.Database;
|
||||
using PlanTempus.Core.Database.ConnectionFactory;
|
||||
|
||||
namespace PlanTempus.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.RegisterType<PostgresConnectionFactory>()
|
||||
.As<IDbConnectionFactory>()
|
||||
.WithParameter(new TypedParameter(typeof(string), ConnectionString))
|
||||
.SingleInstance();
|
||||
|
||||
builder.RegisterType<SqlOperations>()
|
||||
.As<IDatabaseOperations>();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue