diff --git a/src/Microsoft.AspNet.Hosting/HostingServicesCollectionExtensions.cs b/src/Microsoft.AspNet.Hosting/HostingServicesCollectionExtensions.cs index 1c698d3f49..6445c1e4b1 100644 --- a/src/Microsoft.AspNet.Hosting/HostingServicesCollectionExtensions.cs +++ b/src/Microsoft.AspNet.Hosting/HostingServicesCollectionExtensions.cs @@ -13,33 +13,30 @@ namespace Microsoft.Framework.DependencyInjection public static class HostingServicesExtensions { // REVIEW: Logging doesn't depend on DI, where should this live? - public static IServiceCollection AddLogging(this IServiceCollection services, IConfiguration config = null) + public static IServiceCollection AddLogging(this IServiceCollection services) { - var describe = new ServiceDescriber(config); - services.TryAdd(describe.Singleton()); - services.TryAdd(describe.Singleton(typeof(ILogger<>), typeof(Logger<>))); + services.TryAdd(ServiceDescriptor.Singleton()); + services.TryAdd(ServiceDescriptor.Singleton(typeof(ILogger<>), typeof(Logger<>))); return services; } public static IServiceCollection AddHosting(this IServiceCollection services, IConfiguration configuration = null) { - var describer = new ServiceDescriber(configuration); + services.TryAdd(ServiceDescriptor.Transient()); + services.TryAdd(ServiceDescriptor.Transient()); - services.TryAdd(describer.Transient()); - services.TryAdd(describer.Transient()); + services.TryAdd(ServiceDescriptor.Transient()); - services.TryAdd(describer.Transient()); + services.TryAdd(ServiceDescriptor.Transient()); + services.TryAdd(ServiceDescriptor.Transient()); - services.TryAdd(describer.Transient()); - services.TryAdd(describer.Transient()); - - services.TryAdd(describer.Instance(new ApplicationLifetime())); + services.TryAdd(ServiceDescriptor.Instance(new ApplicationLifetime())); services.AddTypeActivator(configuration); // TODO: Do we expect this to be provide by the runtime eventually? - services.AddLogging(configuration); - services.TryAdd(describer.Singleton()); - services.TryAdd(describer.Singleton()); + services.AddLogging(); + services.TryAdd(ServiceDescriptor.Singleton()); + services.TryAdd(ServiceDescriptor.Singleton()); // REVIEW: don't try add because we pull out IEnumerable? services.AddInstance(new ConfigureHostingEnvironment(configuration)); diff --git a/src/Microsoft.AspNet.Hosting/Program.cs b/src/Microsoft.AspNet.Hosting/Program.cs index d050fbf10c..cec49ddb7f 100644 --- a/src/Microsoft.AspNet.Hosting/Program.cs +++ b/src/Microsoft.AspNet.Hosting/Program.cs @@ -7,7 +7,6 @@ using System.Threading; using System.Threading.Tasks; using Microsoft.Framework.ConfigurationModel; using Microsoft.Framework.DependencyInjection; -using Microsoft.Framework.DependencyInjection.Fallback; using Microsoft.Framework.Logging; using Microsoft.Framework.Runtime; diff --git a/src/Microsoft.AspNet.Hosting/Startup/StartupLoader.cs b/src/Microsoft.AspNet.Hosting/Startup/StartupLoader.cs index ba6c013f12..bed2a0190d 100644 --- a/src/Microsoft.AspNet.Hosting/Startup/StartupLoader.cs +++ b/src/Microsoft.AspNet.Hosting/Startup/StartupLoader.cs @@ -8,7 +8,6 @@ using System.Linq; using System.Reflection; using Microsoft.AspNet.Builder; using Microsoft.Framework.DependencyInjection; -using Microsoft.Framework.DependencyInjection.Fallback; namespace Microsoft.AspNet.Hosting.Startup { diff --git a/src/Microsoft.AspNet.RequestContainer/ContainerExtensions.cs b/src/Microsoft.AspNet.RequestContainer/ContainerExtensions.cs index 06d89995f2..35701937ac 100644 --- a/src/Microsoft.AspNet.RequestContainer/ContainerExtensions.cs +++ b/src/Microsoft.AspNet.RequestContainer/ContainerExtensions.cs @@ -6,7 +6,6 @@ using System.Collections.Generic; using Microsoft.AspNet.RequestContainer; using Microsoft.AspNet.Hosting; using Microsoft.Framework.DependencyInjection; -using Microsoft.Framework.DependencyInjection.Fallback; namespace Microsoft.AspNet.Builder { @@ -29,7 +28,7 @@ namespace Microsoft.AspNet.Builder // Note: Manifests are lost after UseServices, services are flattened into ApplicationServices - public static IApplicationBuilder UseServices(this IApplicationBuilder builder, IEnumerable applicationServices) + public static IApplicationBuilder UseServices(this IApplicationBuilder builder, IServiceCollection applicationServices) { return builder.UseServices(services => services.Add(applicationServices)); } diff --git a/src/Microsoft.AspNet.TestHost/TestServer.cs b/src/Microsoft.AspNet.TestHost/TestServer.cs index a626723572..b7350e7c13 100644 --- a/src/Microsoft.AspNet.TestHost/TestServer.cs +++ b/src/Microsoft.AspNet.TestHost/TestServer.cs @@ -11,7 +11,6 @@ using Microsoft.AspNet.Hosting.Server; using Microsoft.AspNet.Http; using Microsoft.Framework.ConfigurationModel; using Microsoft.Framework.DependencyInjection; -using Microsoft.Framework.DependencyInjection.Fallback; using Microsoft.Framework.Runtime; using Microsoft.Framework.Runtime.Infrastructure; diff --git a/test/Microsoft.AspNet.Hosting.Tests/Fakes/Startup.cs b/test/Microsoft.AspNet.Hosting.Tests/Fakes/Startup.cs index efcb11537a..8f61d7e4c3 100644 --- a/test/Microsoft.AspNet.Hosting.Tests/Fakes/Startup.cs +++ b/test/Microsoft.AspNet.Hosting.Tests/Fakes/Startup.cs @@ -3,7 +3,6 @@ using Microsoft.AspNet.Builder; using Microsoft.Framework.DependencyInjection; -using Microsoft.Framework.DependencyInjection.Fallback; using Microsoft.Framework.OptionsModel; using System; diff --git a/test/Microsoft.AspNet.Hosting.Tests/HostingEngineTests.cs b/test/Microsoft.AspNet.Hosting.Tests/HostingEngineTests.cs index 99be47cbf7..d66e77a396 100644 --- a/test/Microsoft.AspNet.Hosting.Tests/HostingEngineTests.cs +++ b/test/Microsoft.AspNet.Hosting.Tests/HostingEngineTests.cs @@ -10,7 +10,6 @@ using Microsoft.AspNet.FeatureModel; using Microsoft.AspNet.Hosting.Server; using Microsoft.Framework.ConfigurationModel; using Microsoft.Framework.DependencyInjection; -using Microsoft.Framework.DependencyInjection.Fallback; using Xunit; namespace Microsoft.AspNet.Hosting diff --git a/test/Microsoft.AspNet.Hosting.Tests/HostingServicesFacts.cs b/test/Microsoft.AspNet.Hosting.Tests/HostingServicesFacts.cs index 5e6e733da8..1ccae6b90c 100644 --- a/test/Microsoft.AspNet.Hosting.Tests/HostingServicesFacts.cs +++ b/test/Microsoft.AspNet.Hosting.Tests/HostingServicesFacts.cs @@ -5,7 +5,6 @@ using System; using System.Collections.Generic; using Microsoft.AspNet.Hosting.Fakes; using Microsoft.Framework.DependencyInjection; -using Microsoft.Framework.DependencyInjection.Fallback; using Microsoft.Framework.Runtime; using Xunit; diff --git a/test/Microsoft.AspNet.Hosting.Tests/StartupManagerTests.cs b/test/Microsoft.AspNet.Hosting.Tests/StartupManagerTests.cs index db19ddc403..cefc9877e7 100644 --- a/test/Microsoft.AspNet.Hosting.Tests/StartupManagerTests.cs +++ b/test/Microsoft.AspNet.Hosting.Tests/StartupManagerTests.cs @@ -7,7 +7,6 @@ using Microsoft.AspNet.Builder; using Microsoft.AspNet.Hosting.Fakes; using Microsoft.AspNet.Hosting.Startup; using Microsoft.Framework.DependencyInjection; -using Microsoft.Framework.DependencyInjection.Fallback; using Microsoft.Framework.OptionsModel; using Xunit; diff --git a/test/Microsoft.AspNet.Hosting.Tests/UseRequestServicesFacts.cs b/test/Microsoft.AspNet.Hosting.Tests/UseRequestServicesFacts.cs index 10859e7323..bc557d59e7 100644 --- a/test/Microsoft.AspNet.Hosting.Tests/UseRequestServicesFacts.cs +++ b/test/Microsoft.AspNet.Hosting.Tests/UseRequestServicesFacts.cs @@ -6,7 +6,6 @@ using Microsoft.AspNet.Builder; using Microsoft.AspNet.Http.Core; using Microsoft.AspNet.RequestContainer; using Microsoft.Framework.DependencyInjection; -using Microsoft.Framework.DependencyInjection.Fallback; using Microsoft.Framework.Logging; using Xunit; diff --git a/test/Microsoft.AspNet.TestHost.Tests/TestClientTests.cs b/test/Microsoft.AspNet.TestHost.Tests/TestClientTests.cs index 467aca2005..b392bac6ad 100644 --- a/test/Microsoft.AspNet.TestHost.Tests/TestClientTests.cs +++ b/test/Microsoft.AspNet.TestHost.Tests/TestClientTests.cs @@ -8,7 +8,7 @@ using System.Threading.Tasks; using Microsoft.AspNet.Builder; using Microsoft.AspNet.Hosting; using Microsoft.AspNet.Http; -using Microsoft.Framework.DependencyInjection.Fallback; +using Microsoft.Framework.DependencyInjection; using Xunit; namespace Microsoft.AspNet.TestHost diff --git a/test/Microsoft.AspNet.TestHost.Tests/TestServerTests.cs b/test/Microsoft.AspNet.TestHost.Tests/TestServerTests.cs index 9838e1d0b3..c9ef3bdf96 100644 --- a/test/Microsoft.AspNet.TestHost.Tests/TestServerTests.cs +++ b/test/Microsoft.AspNet.TestHost.Tests/TestServerTests.cs @@ -10,7 +10,6 @@ using Microsoft.AspNet.Builder; using Microsoft.AspNet.Hosting; using Microsoft.AspNet.Http; using Microsoft.Framework.DependencyInjection; -using Microsoft.Framework.DependencyInjection.Fallback; using Xunit; namespace Microsoft.AspNet.TestHost