Browse Source

Added comment on why you can use AddControllersAsServices() at the ConfigureServices()

pull/68/head
Cesar De la Torre 8 years ago
parent
commit
87d41be255
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      src/Services/Ordering/Ordering.API/Startup.cs

+ 2
- 1
src/Services/Ordering/Ordering.API/Startup.cs View File

@ -45,7 +45,8 @@
services.AddMvc(options =>
{
options.Filters.Add(typeof(HttpGlobalExceptionFilter));
}).AddControllersAsServices(); //Controllers are also injected thru DI
}).AddControllersAsServices(); //Injecting Controllers themselves thru DI
//For further info see: http://docs.autofac.org/en/latest/integration/aspnetcore.html#controllers-as-services
services.AddEntityFrameworkSqlServer()
.AddDbContext<OrderingContext>(options =>


Loading…
Cancel
Save