From 87d41be2557ce09a9b151533785ed1603cacd90e Mon Sep 17 00:00:00 2001 From: Cesar De la Torre Date: Sun, 26 Feb 2017 12:22:38 -0800 Subject: [PATCH] Added comment on why you can use AddControllersAsServices() at the ConfigureServices() --- src/Services/Ordering/Ordering.API/Startup.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Services/Ordering/Ordering.API/Startup.cs b/src/Services/Ordering/Ordering.API/Startup.cs index b0e4a67f2..539647514 100644 --- a/src/Services/Ordering/Ordering.API/Startup.cs +++ b/src/Services/Ordering/Ordering.API/Startup.cs @@ -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(options =>