Skip to content
This repository was archived by the owner on Apr 8, 2020. It is now read-only.

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

Diff for: src/Microsoft.AspNetCore.SpaServices/Prerendering/PrerenderingServiceCollectionExtensions.cs

+2-8
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.Text;
4-
using Microsoft.AspNetCore.Http;
5-
using Microsoft.AspNetCore.NodeServices;
6-
using Microsoft.AspNetCore.SpaServices.Prerendering;
7-
using Microsoft.Extensions.DependencyInjection.Extensions;
1+
using Microsoft.AspNetCore.SpaServices.Prerendering;
82

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

0 commit comments

Comments
 (0)