More reactions to DI

This commit is contained in:
Pranav K 2015-12-17 14:11:58 -08:00
parent 2b77744f96
commit 0720d23a19
2 changed files with 2 additions and 2 deletions

View File

@ -65,7 +65,7 @@ namespace Microsoft.Extensions.DependencyInjection
// //
if (PlatformServices.Default?.LibraryManager != null) if (PlatformServices.Default?.LibraryManager != null)
{ {
services.TryAdd(ServiceDescriptor.Instance(PlatformServices.Default.LibraryManager)); services.TryAddSingleton(PlatformServices.Default.LibraryManager);
} }
// //

View File

@ -24,7 +24,7 @@ namespace Microsoft.AspNet.Mvc.Internal
} }
services.Replace(ServiceDescriptor.Transient<IControllerActivator, ServiceBasedControllerActivator>()); services.Replace(ServiceDescriptor.Transient<IControllerActivator, ServiceBasedControllerActivator>());
services.Replace(ServiceDescriptor.Instance<IControllerTypeProvider>(controllerTypeProvider)); services.Replace(ServiceDescriptor.Singleton<IControllerTypeProvider>(controllerTypeProvider));
} }
public static void AddControllersAsServices(IServiceCollection services, IEnumerable<Assembly> assemblies) public static void AddControllersAsServices(IServiceCollection services, IEnumerable<Assembly> assemblies)