Use AddHttpContextAccessor method added in aspnet/HttpAbstractions#947
This commit is contained in:
parent
9038f193cd
commit
bfbc04f758
|
|
@ -40,7 +40,7 @@ namespace BasicWebSite
|
||||||
|
|
||||||
services.AddLogging();
|
services.AddLogging();
|
||||||
services.AddSingleton<IActionDescriptorProvider, ActionDescriptorCreationCounter>();
|
services.AddSingleton<IActionDescriptorProvider, ActionDescriptorCreationCounter>();
|
||||||
services.AddSingleton<IHttpContextAccessor, HttpContextAccessor>();
|
services.AddHttpContextAccessor();
|
||||||
services.AddSingleton<ContactsRepository>();
|
services.AddSingleton<ContactsRepository>();
|
||||||
services.AddSingleton<IErrorDescriptorProvider, VndErrorDescriptionProvider>();
|
services.AddSingleton<IErrorDescriptorProvider, VndErrorDescriptionProvider>();
|
||||||
services.AddScoped<RequestIdService>();
|
services.AddScoped<RequestIdService>();
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@ namespace ControllersFromServicesWebSite
|
||||||
|
|
||||||
services.AddTransient<QueryValueService>();
|
services.AddTransient<QueryValueService>();
|
||||||
services.AddTransient<ValueService>();
|
services.AddTransient<ValueService>();
|
||||||
services.AddSingleton<IHttpContextAccessor, HttpContextAccessor>();
|
services.AddHttpContextAccessor();
|
||||||
}
|
}
|
||||||
|
|
||||||
private class TypesPart : ApplicationPart, IApplicationPartTypeProvider
|
private class TypesPart : ApplicationPart, IApplicationPartTypeProvider
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue