Skip to content

Commit 9ec1145

Browse files
committed
improvement: minor code changes in startup.cs
1 parent 0bd9641 commit 9ec1145

1 file changed

Lines changed: 4 additions & 8 deletions

File tree

  • ProjectTemplates/AspNetCore.WebApi/ReferenceProject/ReferenceProject

ProjectTemplates/AspNetCore.WebApi/ReferenceProject/ReferenceProject/Startup.cs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -85,23 +85,19 @@ public void ConfigureServices(IServiceCollection services)
8585
public void ConfigureContainer(ContainerBuilder builder)
8686
{
8787
// Add things to the Autofac ContainerBuilder.
88-
ConfigureContainerCommon(builder);
88+
builder.RegisterModule<DefaultModule>();
89+
builder.RegisterModule(new ConfigurationModule(Configuration));
8990
}
9091

9192
// This only gets called if your environment is Production. The
9293
// default ConfigureContainer won't be automatically called if this
9394
// one is called.
9495
public void ConfigureProductionContainer(ContainerBuilder builder)
9596
{
97+
ConfigureContainer(builder);
98+
9699
// Add things to the ContainerBuilder that are only for the
97100
// production environment.
98-
ConfigureContainerCommon(builder);
99-
}
100-
101-
public void ConfigureContainerCommon(ContainerBuilder builder)
102-
{
103-
builder.RegisterModule(new DefaultModule());
104-
builder.RegisterModule(new ConfigurationModule(Configuration));
105101
}
106102

107103
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.

0 commit comments

Comments
 (0)