-
Notifications
You must be signed in to change notification settings - Fork 3
/
Startup.cs
34 lines (32 loc) · 1.25 KB
/
Startup.cs
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
// MIT License
// Copyright DNN Community
using DNN.Modules.DnnUserVoice.Data;
using DNN.Modules.DnnUserVoice.Data.Entities;
using DNN.Modules.DnnUserVoice.Data.Repositories;
using DNN.Modules.DnnUserVoice.Services;
using DotNetNuke.DependencyInjection;
using DotNetNuke.Services.Localization;
using Microsoft.Extensions.DependencyInjection;
using System.Diagnostics.CodeAnalysis;
namespace DNN.Modules.DnnUserVoice
{
/// <summary>
/// Implements the IDnnStartup interface to run at application start.
/// </summary>
[ExcludeFromCodeCoverage]
public class Startup : IDnnStartup
{
/// <summary>
/// Registers the dependencies for injection.
/// </summary>
/// <param name="services">The services collection.</param>
public void ConfigureServices(IServiceCollection services)
{
services.AddScoped<ModuleDbContext, ModuleDbContext>();
services.AddScoped(typeof(IRepository<>), typeof(Repository<>));
services.AddScoped<IItemService>(provider => new ItemService(provider.GetService<IRepository<Item>>()));
services.AddScoped<ILoggingService, LoggingService>();
services.AddScoped<ILocalizationService, LocalizationService>();
}
}
}