mirror of
https://github.com/aspnet/JavaScriptServices.git
synced 2025-12-23 01:58:29 +00:00
22 lines
843 B
C#
22 lines
843 B
C#
using Microsoft.AspNetCore.SpaServices.Prerendering;
|
|
|
|
namespace Microsoft.Extensions.DependencyInjection
|
|
{
|
|
/// <summary>
|
|
/// Extension methods for setting up prerendering features in an <see cref="IServiceCollection" />.
|
|
/// </summary>
|
|
public static class PrerenderingServiceCollectionExtensions
|
|
{
|
|
/// <summary>
|
|
/// Configures the dependency injection system to supply an implementation
|
|
/// of <see cref="ISpaPrerenderer"/>.
|
|
/// </summary>
|
|
/// <param name="serviceCollection">The <see cref="IServiceCollection"/>.</param>
|
|
public static void AddSpaPrerenderer(this IServiceCollection serviceCollection)
|
|
{
|
|
serviceCollection.AddHttpContextAccessor();
|
|
serviceCollection.AddSingleton<ISpaPrerenderer, DefaultSpaPrerenderer>();
|
|
}
|
|
}
|
|
}
|