Clean up how IHttpContextAccessor is added

This commit is contained in:
Steve Sanderson 2017-10-23 15:13:33 +01:00
Родитель ba0d82d801
Коммит e583a17ef8
1 изменённых файлов: 2 добавлений и 8 удалений

Просмотреть файл

@ -1,10 +1,4 @@
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.NodeServices;
using Microsoft.AspNetCore.SpaServices.Prerendering;
using Microsoft.Extensions.DependencyInjection.Extensions;
using Microsoft.AspNetCore.SpaServices.Prerendering;
namespace Microsoft.Extensions.DependencyInjection
{
@ -20,7 +14,7 @@ namespace Microsoft.Extensions.DependencyInjection
/// <param name="serviceCollection">The <see cref="IServiceCollection"/>.</param>
public static void AddSpaPrerenderer(this IServiceCollection serviceCollection)
{
serviceCollection.TryAddSingleton<IHttpContextAccessor, HttpContextAccessor>();
serviceCollection.AddHttpContextAccessor();
serviceCollection.AddSingleton<ISpaPrerenderer, DefaultSpaPrerenderer>();
}
}