Skip to content

Commit

Permalink
Merge pull request #166 from Resgrid/develop
Browse files Browse the repository at this point in the history
CU-868ba84kp fixing bug with db container reg
  • Loading branch information
ucswift authored Dec 31, 2024
2 parents d84dcfc + af3d229 commit 52798f9
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 52798f9

Please sign in to comment.