-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Expand file tree
/
Copy pathModuleInitializer.cs
More file actions
36 lines (32 loc) · 1.46 KB
/
ModuleInitializer.cs
File metadata and controls
36 lines (32 loc) · 1.46 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
using MediatR;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.DependencyInjection;
using SimplCommerce.Infrastructure;
using SimplCommerce.Infrastructure.Modules;
using SimplCommerce.Module.Catalog.Data;
using SimplCommerce.Module.Catalog.Events;
using SimplCommerce.Module.Catalog.Services;
using SimplCommerce.Module.Core.Events;
using SimplCommerce.AI.Recommendation;
namespace SimplCommerce.Module.Catalog
{
public class ModuleInitializer : IModuleInitializer
{
public void ConfigureServices(IServiceCollection services)
{
services.AddSingleton<IRecommendationService, RecommendationService>();
services.AddTransient<IProductTemplateProductAttributeRepository, ProductTemplateProductAttributeRepository>();
services.AddTransient<INotificationHandler<ReviewSummaryChanged>, ReviewSummaryChangedHandler>();
services.AddTransient<IBrandService, BrandService>();
services.AddTransient<ICategoryService, CategoryService>();
services.AddTransient<IProductPricingService, ProductPricingService>();
services.AddTransient<IProductService, ProductService>();
services.AddHostedService<RecommendationTrainingBackgroundService>();
GlobalConfiguration.RegisterAngularModule("simplAdmin.catalog");
}
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
}
}
}