-
Notifications
You must be signed in to change notification settings - Fork 39
/
ServiceCollectionExtensionsData_cs.hbs
34 lines (30 loc) · 1.25 KB
/
ServiceCollectionExtensionsData_cs.hbs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/*
* This file is automatically generated; any changes will be lost.
*/
{{#if Root.PreprocessorDirectives}}
#nullable enable
#pragma warning disable
{{/if}}
namespace Microsoft.Extensions.DependencyInjection;
/// <summary>
/// Provides the generated <b>Data</b>-layer services.
/// </summary>
public static partial class {{#if IsRefData}}ReferenceData{{/if}}ServiceCollectionsExtension
{
/// <summary>
/// Adds the generated <b>Data</b>-layer services.
/// </summary>
/// <param name="services">The <see cref="IServiceCollection"/>.</param>
/// <returns>The <see cref="IServiceCollection"/>.</returns>
public static IServiceCollection AddGenerated{{#if IsRefData}}ReferenceData{{/if}}DataServices(this IServiceCollection services)
{
{{#if IsRefData}}
return services.AddScoped<IReferenceDataData, ReferenceDataData>(){{#ifeq IDataEntities.Count 0}};{{/ifeq}}
{{/if}}
{{#each IDataEntities}}
{{#if @first}}{{#if Root.IsRefData}} {{else}}return services{{/if}}{{else}} {{/if}}.AddScoped<I{{Name}}Data{{#if GenericWithT}}<T>{{/if}}, {{Name}}Data{{#if GenericWithT}}<T>{{/if}}>(){{#if @last}};{{/if}}
{{/each}}
}
}{{#if Root.PreprocessorDirectives}}
#pragma warning restore
#nullable restore{{/if}}