-
-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathServiceCollectionExtensions.cs
More file actions
22 lines (19 loc) · 862 Bytes
/
Copy pathServiceCollectionExtensions.cs
File metadata and controls
22 lines (19 loc) · 862 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
using OrchardCoreContrib.Templating;
using OrchardCoreContrib.Templating.Razor.Services;
namespace Microsoft.Extensions.DependencyInjection;
/// <summary>
/// Provides extension methods for registering the Razor template engine services in an <see cref="IServiceCollection"/>.
/// </summary>
public static class ServiceCollectionExtensions
{
/// <summary>
/// Registers the Razor template engine services in the specified <see cref="IServiceCollection"/>.
/// </summary>
/// <param name="services">The <see cref="IServiceCollection"/> to add the services to.</param>
/// <returns>The updated <see cref="IServiceCollection"/>.</returns>
public static IServiceCollection AddRazorTemplating(this IServiceCollection services)
{
services.AddSingleton<ITemplateEngine, RazorTemplateEngine>();
return services;
}
}