Added comment on why you can use AddControllersAsServices() at the ConfigureServices()
This commit is contained in:
parent
a1f4082ee3
commit
87d41be255
@ -45,7 +45,8 @@
|
|||||||
services.AddMvc(options =>
|
services.AddMvc(options =>
|
||||||
{
|
{
|
||||||
options.Filters.Add(typeof(HttpGlobalExceptionFilter));
|
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()
|
services.AddEntityFrameworkSqlServer()
|
||||||
.AddDbContext<OrderingContext>(options =>
|
.AddDbContext<OrderingContext>(options =>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user