More work on this Console Host
This commit is contained in:
parent
1501ff442a
commit
8dd01d291d
11 changed files with 336 additions and 344 deletions
|
|
@ -3,11 +3,7 @@ using Npgsql;
|
|||
using System.Data;
|
||||
namespace PlanTempus.Database.ModuleRegistry
|
||||
{
|
||||
public interface IDbConnectionFactory
|
||||
{
|
||||
IDbConnection Create();
|
||||
IDbConnection Create(string username, string password);
|
||||
}
|
||||
|
||||
public class DbPostgreSqlModule : Module
|
||||
{
|
||||
public required string ConnectionString { get; set; }
|
||||
|
|
@ -16,7 +12,7 @@ namespace PlanTempus.Database.ModuleRegistry
|
|||
{
|
||||
Insight.Database.Providers.PostgreSQL.PostgreSQLInsightDbProvider.RegisterProvider();
|
||||
|
||||
builder.Register<IDbConnectionFactory>(c =>
|
||||
builder.Register<Core.ConnectionFactory.IDbConnectionFactory>(c =>
|
||||
new Core.ConnectionFactory.PostgresConnectionFactory(ConnectionString))
|
||||
.SingleInstance();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue