diff --git a/src/Microsoft.AspNet.Hosting/Startup/StartupLoader.cs b/src/Microsoft.AspNet.Hosting/Startup/StartupLoader.cs index 24770cd502..ba48bd211c 100644 --- a/src/Microsoft.AspNet.Hosting/Startup/StartupLoader.cs +++ b/src/Microsoft.AspNet.Hosting/Startup/StartupLoader.cs @@ -29,18 +29,18 @@ namespace Microsoft.AspNet.Hosting.Startup { var methodNameWithEnv = string.Format(CultureInfo.InvariantCulture, methodName, environmentName); var methodNameWithNoEnv = string.Format(CultureInfo.InvariantCulture, methodName, ""); - var methodInfo = startupType.GetMethod(methodNameWithEnv, BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static) - ?? startupType.GetMethod(methodNameWithNoEnv, BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static); - if (methodInfo == null) + var methodInfo = startupType.GetMethod(methodNameWithEnv, BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static) + ?? startupType.GetMethod(methodNameWithNoEnv, BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static); + if (methodInfo == null) { if (required) - { - throw new Exception(string.Format("TODO: {0} or {1} method not found", - methodNameWithEnv, - methodNameWithNoEnv)); + { + throw new Exception(string.Format("TODO: {0} or {1} method not found", + methodNameWithEnv, + methodNameWithNoEnv)); - } - return null; + } + return null; } if (returnType != null && methodInfo.ReturnType != returnType) { @@ -160,7 +160,7 @@ namespace Microsoft.AspNet.Hosting.Startup } else { - // void ConfigureServices(IServiceCollection) + // void ConfigureServices(IServiceCollection) Invoke(servicesMethod, instance, builder, services); if (builder != null) { diff --git a/test/Microsoft.AspNet.Hosting.Tests/Fakes/Startup.cs b/test/Microsoft.AspNet.Hosting.Tests/Fakes/Startup.cs index 54ef6de669..efcb11537a 100644 --- a/test/Microsoft.AspNet.Hosting.Tests/Fakes/Startup.cs +++ b/test/Microsoft.AspNet.Hosting.Tests/Fakes/Startup.cs @@ -31,7 +31,7 @@ namespace Microsoft.AspNet.Hosting.Fakes }); } - public void ConfigureRetailServices(IServiceCollection services) + public void ConfigureRetailServices(IServiceCollection services) { services.AddOptions(); services.Configure(o => @@ -94,8 +94,8 @@ namespace Microsoft.AspNet.Hosting.Fakes return services.BuildServiceProvider(); } - public virtual void Configure(IApplicationBuilder builder) - { - } - } + public virtual void Configure(IApplicationBuilder builder) + { + } + } } \ No newline at end of file diff --git a/test/Microsoft.AspNet.Hosting.Tests/Fakes/StartupBase.cs b/test/Microsoft.AspNet.Hosting.Tests/Fakes/StartupBase.cs index f1ee427a87..7fbe35cffb 100644 --- a/test/Microsoft.AspNet.Hosting.Tests/Fakes/StartupBase.cs +++ b/test/Microsoft.AspNet.Hosting.Tests/Fakes/StartupBase.cs @@ -15,15 +15,15 @@ namespace Microsoft.AspNet.Hosting.Fakes { } - public void ConfigureBaseClassServices(IServiceCollection services) - { - services.AddOptions(); - services.Configure(o => - { - o.Configured = true; - o.Environment = "BaseClass"; - }); - } + public void ConfigureBaseClassServices(IServiceCollection services) + { + services.AddOptions(); + services.Configure(o => + { + o.Configured = true; + o.Environment = "BaseClass"; + }); + } - } + } } \ No newline at end of file diff --git a/test/Microsoft.AspNet.Hosting.Tests/StartupManagerTests.cs b/test/Microsoft.AspNet.Hosting.Tests/StartupManagerTests.cs index 46758b92bc..29aa84173c 100644 --- a/test/Microsoft.AspNet.Hosting.Tests/StartupManagerTests.cs +++ b/test/Microsoft.AspNet.Hosting.Tests/StartupManagerTests.cs @@ -42,8 +42,8 @@ namespace Microsoft.AspNet.Hosting.Tests [InlineData("StaticProvider")] [InlineData("Provider")] [InlineData("ProviderArgs")] - [InlineData("BaseClass")] - public void StartupClassAddsConfigureServicesToApplicationServices(string environment) + [InlineData("BaseClass")] + public void StartupClassAddsConfigureServicesToApplicationServices(string environment) { var services = HostingServices.Create().BuildServiceProvider(); var manager = services.GetRequiredService();