Switch from tabs to spaces
This commit is contained in:
parent
fe3675a9e0
commit
e95472e953
|
|
@ -29,18 +29,18 @@ namespace Microsoft.AspNet.Hosting.Startup
|
||||||
{
|
{
|
||||||
var methodNameWithEnv = string.Format(CultureInfo.InvariantCulture, methodName, environmentName);
|
var methodNameWithEnv = string.Format(CultureInfo.InvariantCulture, methodName, environmentName);
|
||||||
var methodNameWithNoEnv = string.Format(CultureInfo.InvariantCulture, methodName, "");
|
var methodNameWithNoEnv = string.Format(CultureInfo.InvariantCulture, methodName, "");
|
||||||
var methodInfo = startupType.GetMethod(methodNameWithEnv, BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static)
|
var methodInfo = startupType.GetMethod(methodNameWithEnv, BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static)
|
||||||
?? startupType.GetMethod(methodNameWithNoEnv, BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static);
|
?? startupType.GetMethod(methodNameWithNoEnv, BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static);
|
||||||
if (methodInfo == null)
|
if (methodInfo == null)
|
||||||
{
|
{
|
||||||
if (required)
|
if (required)
|
||||||
{
|
{
|
||||||
throw new Exception(string.Format("TODO: {0} or {1} method not found",
|
throw new Exception(string.Format("TODO: {0} or {1} method not found",
|
||||||
methodNameWithEnv,
|
methodNameWithEnv,
|
||||||
methodNameWithNoEnv));
|
methodNameWithNoEnv));
|
||||||
|
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
if (returnType != null && methodInfo.ReturnType != returnType)
|
if (returnType != null && methodInfo.ReturnType != returnType)
|
||||||
{
|
{
|
||||||
|
|
@ -160,7 +160,7 @@ namespace Microsoft.AspNet.Hosting.Startup
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// void ConfigureServices(IServiceCollection)
|
// void ConfigureServices(IServiceCollection)
|
||||||
Invoke(servicesMethod, instance, builder, services);
|
Invoke(servicesMethod, instance, builder, services);
|
||||||
if (builder != null)
|
if (builder != null)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ namespace Microsoft.AspNet.Hosting.Fakes
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ConfigureRetailServices(IServiceCollection services)
|
public void ConfigureRetailServices(IServiceCollection services)
|
||||||
{
|
{
|
||||||
services.AddOptions();
|
services.AddOptions();
|
||||||
services.Configure<FakeOptions>(o =>
|
services.Configure<FakeOptions>(o =>
|
||||||
|
|
@ -94,8 +94,8 @@ namespace Microsoft.AspNet.Hosting.Fakes
|
||||||
return services.BuildServiceProvider();
|
return services.BuildServiceProvider();
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual void Configure(IApplicationBuilder builder)
|
public virtual void Configure(IApplicationBuilder builder)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -15,15 +15,15 @@ namespace Microsoft.AspNet.Hosting.Fakes
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ConfigureBaseClassServices(IServiceCollection services)
|
public void ConfigureBaseClassServices(IServiceCollection services)
|
||||||
{
|
{
|
||||||
services.AddOptions();
|
services.AddOptions();
|
||||||
services.Configure<FakeOptions>(o =>
|
services.Configure<FakeOptions>(o =>
|
||||||
{
|
{
|
||||||
o.Configured = true;
|
o.Configured = true;
|
||||||
o.Environment = "BaseClass";
|
o.Environment = "BaseClass";
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -42,8 +42,8 @@ namespace Microsoft.AspNet.Hosting.Tests
|
||||||
[InlineData("StaticProvider")]
|
[InlineData("StaticProvider")]
|
||||||
[InlineData("Provider")]
|
[InlineData("Provider")]
|
||||||
[InlineData("ProviderArgs")]
|
[InlineData("ProviderArgs")]
|
||||||
[InlineData("BaseClass")]
|
[InlineData("BaseClass")]
|
||||||
public void StartupClassAddsConfigureServicesToApplicationServices(string environment)
|
public void StartupClassAddsConfigureServicesToApplicationServices(string environment)
|
||||||
{
|
{
|
||||||
var services = HostingServices.Create().BuildServiceProvider();
|
var services = HostingServices.Create().BuildServiceProvider();
|
||||||
var manager = services.GetRequiredService<IStartupManager>();
|
var manager = services.GetRequiredService<IStartupManager>();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue