diff --git a/src/Microsoft.AspNet.Hosting/PlatformHelper.cs b/src/Microsoft.AspNet.Hosting/PlatformHelper.cs deleted file mode 100644 index fbe16751c1..0000000000 --- a/src/Microsoft.AspNet.Hosting/PlatformHelper.cs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System; - -namespace Microsoft.AspNet.Hosting -{ - internal static class PlatformHelper - { - private static Lazy _isMono = new Lazy(() => Type.GetType("Mono.Runtime") != null); - - public static bool IsMono - { - get - { - return _isMono.Value; - } - } - } -} \ No newline at end of file diff --git a/src/Microsoft.AspNet.Hosting/Startup/ConfigureServicesDelegate.cs b/src/Microsoft.AspNet.Hosting/Startup/ConfigureServicesDelegate.cs index 0935c7a69d..977cb07238 100644 --- a/src/Microsoft.AspNet.Hosting/Startup/ConfigureServicesDelegate.cs +++ b/src/Microsoft.AspNet.Hosting/Startup/ConfigureServicesDelegate.cs @@ -9,8 +9,6 @@ using Microsoft.Framework.Internal; namespace Microsoft.AspNet.Hosting.Startup { - public delegate IServiceProvider ConfigureServicesDelegate(IServiceCollection services); - public class ConfigureServicesBuilder { public ConfigureServicesBuilder([NotNull] MethodInfo configureServices) @@ -28,7 +26,7 @@ namespace Microsoft.AspNet.Hosting.Startup public MethodInfo MethodInfo { get; } - public ConfigureServicesDelegate Build(object instance) => services => Invoke(instance, services); + public Func Build(object instance) => services => Invoke(instance, services); private IServiceProvider Invoke(object instance, [NotNull] IServiceCollection exportServices) { diff --git a/src/Microsoft.AspNet.Hosting/Startup/StartupMethods.cs b/src/Microsoft.AspNet.Hosting/Startup/StartupMethods.cs index c213a681d3..e8b61efdab 100644 --- a/src/Microsoft.AspNet.Hosting/Startup/StartupMethods.cs +++ b/src/Microsoft.AspNet.Hosting/Startup/StartupMethods.cs @@ -9,19 +9,20 @@ namespace Microsoft.AspNet.Hosting.Startup { public class StartupMethods { - internal static ConfigureServicesDelegate DefaultBuildServiceProvider = s => s.BuildServiceProvider(); + internal static Func DefaultBuildServiceProvider = s => s.BuildServiceProvider(); - public StartupMethods(Action configure) - : this(configure, configureServices: null) { } + public StartupMethods(Action configure) + : this(configure, configureServices: null) + { + } - // TODO: switch to ConfigureDelegate eventually - public StartupMethods(Action configure, ConfigureServicesDelegate configureServices) + public StartupMethods(Action configure, Func configureServices) { ConfigureDelegate = configure; ConfigureServicesDelegate = configureServices ?? DefaultBuildServiceProvider; } - public ConfigureServicesDelegate ConfigureServicesDelegate { get; } + public Func ConfigureServicesDelegate { get; } public Action ConfigureDelegate { get; } } diff --git a/src/Microsoft.AspNet.Hosting/WebHostBuilder.cs b/src/Microsoft.AspNet.Hosting/WebHostBuilder.cs index 256f615597..06ae275e29 100644 --- a/src/Microsoft.AspNet.Hosting/WebHostBuilder.cs +++ b/src/Microsoft.AspNet.Hosting/WebHostBuilder.cs @@ -167,7 +167,7 @@ namespace Microsoft.AspNet.Hosting return UseStartup(configureApp, configureServices: null); } - public WebHostBuilder UseStartup([NotNull] Action configureApp, ConfigureServicesDelegate configureServices) + public WebHostBuilder UseStartup([NotNull] Action configureApp, Func configureServices) { _startup = new StartupMethods(configureApp, configureServices); return this;