Reacting to DI changes
This commit is contained in:
parent
70f9431e7f
commit
a036ff4738
|
|
@ -123,7 +123,7 @@ namespace Microsoft.Extensions.DependencyInjection
|
|||
{
|
||||
if (CompilationServices.Default != null)
|
||||
{
|
||||
services.TryAdd(ServiceDescriptor.Instance(CompilationServices.Default.LibraryExporter));
|
||||
services.TryAddSingleton(CompilationServices.Default.LibraryExporter);
|
||||
}
|
||||
|
||||
services.TryAddEnumerable(
|
||||
|
|
@ -165,7 +165,7 @@ namespace Microsoft.Extensions.DependencyInjection
|
|||
|
||||
if (PlatformServices.Default?.AssemblyLoadContextAccessor != null)
|
||||
{
|
||||
services.TryAdd(ServiceDescriptor.Instance(PlatformServices.Default.AssemblyLoadContextAccessor));
|
||||
services.TryAddSingleton(PlatformServices.Default.AssemblyLoadContextAccessor);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ namespace Microsoft.AspNet.Mvc.Localization.Internal
|
|||
collection.Add(ServiceDescriptor.Singleton(typeof(IHtmlLocalizerFactory), typeof(TestHtmlLocalizerFactory)));
|
||||
collection.Add(ServiceDescriptor.Transient(typeof(IHtmlLocalizer<>), typeof(TestHtmlLocalizer<>)));
|
||||
collection.Add(ServiceDescriptor.Transient(typeof(IViewLocalizer), typeof(TestViewLocalizer)));
|
||||
collection.Add(ServiceDescriptor.Instance(typeof(HtmlEncoder), testEncoder));
|
||||
collection.Add(ServiceDescriptor.Singleton(typeof(HtmlEncoder), testEncoder));
|
||||
|
||||
MvcLocalizationServices.AddMvcLocalizationServices(
|
||||
collection,
|
||||
|
|
@ -125,7 +125,7 @@ namespace Microsoft.AspNet.Mvc.Localization.Internal
|
|||
|
||||
collection.Add(ServiceDescriptor.Transient(typeof(IHtmlLocalizer<>), typeof(TestHtmlLocalizer<>)));
|
||||
collection.Add(ServiceDescriptor.Transient(typeof(IHtmlLocalizer), typeof(TestViewLocalizer)));
|
||||
collection.Add(ServiceDescriptor.Instance(typeof(HtmlEncoder), typeof(HtmlTestEncoder)));
|
||||
collection.Add(ServiceDescriptor.Singleton(typeof(HtmlEncoder), typeof(HtmlTestEncoder)));
|
||||
|
||||
// Assert
|
||||
Assert.Collection(collection,
|
||||
|
|
|
|||
Loading…
Reference in New Issue