Repository navigation
Expand file tree
/
Copy pathModuleInitializer.cs
More file actions
39 lines (38 loc) · 1.73 KB
/
Copy pathModuleInitializer.cs
File metadata and controls
39 lines (38 loc) · 1.73 KB
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
35
36
37
38
39
using Itsomax.Data.Infrastructure;
using Itsomax.Module.Core.Data;
using Itsomax.Module.Core.Extensions;
using Itsomax.Module.Core.Interfaces;
using Itsomax.Module.Core.Models;
using Itsomax.Module.Core.Services;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Identity;
using Microsoft.Extensions.DependencyInjection;
namespace Itsomax.Module.Core
{
public class ModuleInitializer : IModuleInitializer
{
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
}
public void ConfigureServices(IServiceCollection serviceCollection)
{
serviceCollection.AddScoped<SignInManager<User>, ItsomaxSignInManager<User>>();
serviceCollection.AddSingleton<ICreateMenu, CreateMenu>();
serviceCollection.AddScoped<IEmailService, EmailService>();
serviceCollection.AddSingleton<IGetRemoteInformation, GetRemoteInformation>();
serviceCollection.AddScoped<ILogginToDatabase, LogginToDatabase>();
serviceCollection.AddSingleton<IManageExcelFile, ManageExcelFile>();
serviceCollection.AddSingleton<IManageFiles, ManageFiles>();
serviceCollection.AddAuthorization(options =>
{
options.AddPolicy("ManageAuthentification",
policy => policy.Requirements.Add(new ManageAuthentificationRequirement()));
});
serviceCollection.AddSingleton<IAuthorizationHandler,ManageAuthentificationHandler>();
serviceCollection.AddScoped<ICustomRepositoryFunctions, CustomRepositoryFunctions>();
serviceCollection.AddTransient<GetSettings>();
}
}
}