Skip to content

Commit

Permalink
CU-868ba84kp fixing bug with db container reg
Browse files Browse the repository at this point in the history
  • Loading branch information
ucswift committed Dec 31, 2024
1 parent 6450fbe commit af3d229
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,20 @@ protected override void Load(ContainerBuilder builder)
builder.RegisterType<StandardIsolation>().As<IISolationLevel>().InstancePerLifetimeScope();

builder.RegisterType<QueryList>().As<IQueryList>().InstancePerLifetimeScope();
//builder.RegisterType<SqlServerConfiguration>().As<SqlConfiguration>().InstancePerLifetimeScope();
builder.RegisterType<PostgreSqlConfiguration>().As<SqlConfiguration>().InstancePerLifetimeScope();

if (Config.DataConfig.DatabaseType == Config.DatabaseTypes.Postgres)
{
builder.RegisterType<PostgreSqlConfiguration>().As<SqlConfiguration>().InstancePerLifetimeScope();
builder.RegisterType<PostgreSqlConnectionProvider>().As<IConnectionProvider>().InstancePerLifetimeScope();
}
else
{
builder.RegisterType<SqlServerConfiguration>().As<SqlConfiguration>().InstancePerLifetimeScope();
builder.RegisterType<SqlServerConnectionProvider>().As<IConnectionProvider>().InstancePerLifetimeScope();
}

builder.RegisterType<UnitOfWork>().As<IUnitOfWork>().InstancePerLifetimeScope();
builder.RegisterType<QueryFactory>().As<IQueryFactory>().InstancePerLifetimeScope();
//builder.RegisterType<SqlServerConnectionProvider>().As<IConnectionProvider>().InstancePerLifetimeScope();
builder.RegisterType<PostgreSqlConnectionProvider>().As<IConnectionProvider>().InstancePerLifetimeScope();

// Custom Repositories
builder.RegisterType<UserStatesRepository>().As<IUserStatesRepository>().InstancePerLifetimeScope();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,20 @@ protected override void Load(ContainerBuilder builder)
{
builder.RegisterType<StandardIsolation>().As<IISolationLevel>().InstancePerLifetimeScope();

if (Config.DataConfig.DatabaseType == Config.DatabaseTypes.Postgres)
{
builder.RegisterType<PostgreSqlConfiguration>().As<SqlConfiguration>().InstancePerLifetimeScope();
builder.RegisterType<PostgreSqlConnectionProvider>().As<IConnectionProvider>().InstancePerLifetimeScope();
}
else
{
builder.RegisterType<SqlServerConfiguration>().As<SqlConfiguration>().InstancePerLifetimeScope();
builder.RegisterType<SqlServerConnectionProvider>().As<IConnectionProvider>().InstancePerLifetimeScope();
}

builder.RegisterType<QueryList>().As<IQueryList>().InstancePerLifetimeScope();
//builder.RegisterType<SqlServerConfiguration>().As<SqlConfiguration>().InstancePerLifetimeScope();
builder.RegisterType<PostgreSqlConfiguration>().As<SqlConfiguration>().InstancePerLifetimeScope();
builder.RegisterType<UnitOfWork>().As<IUnitOfWork>().InstancePerLifetimeScope();
builder.RegisterType<QueryFactory>().As<IQueryFactory>().InstancePerLifetimeScope();
//builder.RegisterType<SqlServerConnectionProvider>().As<IConnectionProvider>().InstancePerLifetimeScope();
builder.RegisterType<PostgreSqlConnectionProvider>().As<IConnectionProvider>().InstancePerLifetimeScope();

// Custom Repositories
builder.RegisterType<UserStatesRepository>().As<IUserStatesRepository>().InstancePerLifetimeScope();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,20 @@ protected override void Load(ContainerBuilder builder)
{
builder.RegisterType<StandardIsolation>().As<IISolationLevel>().InstancePerLifetimeScope();

if (Config.DataConfig.DatabaseType == Config.DatabaseTypes.Postgres)
{
builder.RegisterType<PostgreSqlConfiguration>().As<SqlConfiguration>().InstancePerLifetimeScope();
builder.RegisterType<PostgreSqlConnectionProvider>().As<IConnectionProvider>().InstancePerLifetimeScope();
}
else
{
builder.RegisterType<SqlServerConfiguration>().As<SqlConfiguration>().InstancePerLifetimeScope();
builder.RegisterType<SqlServerConnectionProvider>().As<IConnectionProvider>().InstancePerLifetimeScope();
}

builder.RegisterType<QueryList>().As<IQueryList>().InstancePerLifetimeScope();
//builder.RegisterType<SqlServerConfiguration>().As<SqlConfiguration>().InstancePerLifetimeScope();
builder.RegisterType<PostgreSqlConfiguration>().As<SqlConfiguration>().InstancePerLifetimeScope();
builder.RegisterType<UnitOfWork>().As<IUnitOfWork>().InstancePerLifetimeScope();
builder.RegisterType<QueryFactory>().As<IQueryFactory>().InstancePerLifetimeScope();
//builder.RegisterType<SqlServerConnectionProvider>().As<IConnectionProvider>().InstancePerLifetimeScope();
builder.RegisterType<PostgreSqlConnectionProvider>().As<IConnectionProvider>().InstancePerLifetimeScope();

// Custom Repositories
builder.RegisterType<UserStatesRepository>().As<IUserStatesRepository>().InstancePerLifetimeScope();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,20 @@ protected override void Load(ContainerBuilder builder)
{
builder.RegisterType<StandardIsolation>().As<IISolationLevel>().InstancePerLifetimeScope();

if (Config.DataConfig.DatabaseType == Config.DatabaseTypes.Postgres)
{
builder.RegisterType<PostgreSqlConfiguration>().As<SqlConfiguration>().InstancePerLifetimeScope();
builder.RegisterType<PostgreSqlConnectionProvider>().As<IConnectionProvider>().InstancePerLifetimeScope();
}
else
{
builder.RegisterType<SqlServerConfiguration>().As<SqlConfiguration>().InstancePerLifetimeScope();
builder.RegisterType<SqlServerConnectionProvider>().As<IConnectionProvider>().InstancePerLifetimeScope();
}

builder.RegisterType<QueryList>().As<IQueryList>().InstancePerLifetimeScope();
//builder.RegisterType<SqlServerConfiguration>().As<SqlConfiguration>().InstancePerLifetimeScope();
builder.RegisterType<PostgreSqlConfiguration>().As<SqlConfiguration>().InstancePerLifetimeScope();
builder.RegisterType<UnitOfWork>().As<IUnitOfWork>().InstancePerLifetimeScope();
builder.RegisterType<QueryFactory>().As<IQueryFactory>().InstancePerLifetimeScope();
//builder.RegisterType<SqlServerConnectionProvider>().As<IConnectionProvider>().InstancePerLifetimeScope();
builder.RegisterType<PostgreSqlConnectionProvider>().As<IConnectionProvider>().InstancePerLifetimeScope();

// Custom Repositories
builder.RegisterType<UserStatesRepository>().As<IUserStatesRepository>().InstancePerLifetimeScope();
Expand Down

0 comments on commit af3d229

Please sign in to comment.