Skip to content

Commit 87d41be

Browse files
Added comment on why you can use AddControllersAsServices() at the ConfigureServices()
1 parent a1f4082 commit 87d41be

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/Services/Ordering/Ordering.API/Startup.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ public IServiceProvider ConfigureServices(IServiceCollection services)
4545
services.AddMvc(options =>
4646
{
4747
options.Filters.Add(typeof(HttpGlobalExceptionFilter));
48-
}).AddControllersAsServices(); //Controllers are also injected thru DI
48+
}).AddControllersAsServices(); //Injecting Controllers themselves thru DI
49+
//For further info see: http://docs.autofac.org/en/latest/integration/aspnetcore.html#controllers-as-services
4950

5051
services.AddEntityFrameworkSqlServer()
5152
.AddDbContext<OrderingContext>(options =>

0 commit comments

Comments
 (0)