Skip to content

Commit e583a17

Browse files
Clean up how IHttpContextAccessor is added
1 parent ba0d82d commit e583a17

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

‎src/Microsoft.AspNetCore.SpaServices/Prerendering/PrerenderingServiceCollectionExtensions.cs‎

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
1-
usingSystem;
2-
usingSystem.Collections.Generic;
3-
usingSystem.Text;
4-
usingMicrosoft.AspNetCore.Http;
5-
usingMicrosoft.AspNetCore.NodeServices;
6-
usingMicrosoft.AspNetCore.SpaServices.Prerendering;
7-
usingMicrosoft.Extensions.DependencyInjection.Extensions;
1+
usingMicrosoft.AspNetCore.SpaServices.Prerendering;
82

93
namespaceMicrosoft.Extensions.DependencyInjection
104
{
@@ -20,7 +14,7 @@ public static class PrerenderingServiceCollectionExtensions
2014
/// <param name="serviceCollection">The <see cref="IServiceCollection"/>.</param>
2115
publicstaticvoidAddSpaPrerenderer(thisIServiceCollectionserviceCollection)
2216
{
23-
serviceCollection.TryAddSingleton<IHttpContextAccessor,HttpContextAccessor>();
17+
serviceCollection.AddHttpContextAccessor();
2418
serviceCollection.AddSingleton<ISpaPrerenderer,DefaultSpaPrerenderer>();
2519
}
2620
}

0 commit comments

Comments
(0)