CourseWork_FurnitureFactory/FurnitureFactory/MasterWebClient/Program.cs

56 lines
2.6 KiB
C#
Raw Normal View History

2023-05-19 19:15:38 +04:00
using FurnitureContracts.BusinessLogicsContracts;
using FurnitureContracts.StoragesContracts;
using FurnitureFactoryBusinessLogic.BusinessLogic;
using FurnitureFactoryBusinessLogic.OfficePackage;
using FurnitureFactoryBusinessLogic.OfficePackage.Implements;
using FurnitureFactoryDataBaseImplement.Implements;
using FurnitureFactoryDataBaseImplements.Implements;
var builder = WebApplication.CreateBuilder(args);
builder.Logging.SetMinimumLevel(LogLevel.Trace);
builder.Logging.AddLog4Net("log4net.config");
builder.Services.AddTransient<IManagerStorage, ManagerStorage>();
builder.Services.AddTransient<ISalesSalonsStorage, SalesSalonStorage>();
builder.Services.AddTransient<IHeadsetStorage, HeadsetStorage>();
builder.Services.AddTransient<IOrdersStorage, OrderStorage>();
builder.Services.AddTransient<IHeadsetModuleStorage, HeadsetModuleStorage>();
builder.Services.AddTransient<IMasterStorage, MasterStorage>();
builder.Services.AddTransient<IMaterialStorage, MaterialStorage>();
builder.Services.AddTransient<IFurnitureStorage, FurnitureStorage>();
builder.Services.AddTransient<IManagerLogic, ManagerLogic>();
builder.Services.AddTransient<ISalesSalonsLogic, SalesSalonLogic>();
builder.Services.AddTransient<IHeadsetLogic, HeadsetLogic>();
builder.Services.AddTransient<IOrderLogic, OrderLogic>();
builder.Services.AddTransient<IHeadsetModuleLogic, HeadsetModuleLogic>();
builder.Services.AddTransient<IReportLogic, ReportLogic>();
builder.Services.AddTransient<IMasterLogic, MasterLogic>();
builder.Services.AddTransient<IMaterialLogic, MaterialLogic>();
builder.Services.AddTransient<IFurnitureLogic, FurnitureLogic>();
builder.Services.AddTransient<AbstractSaveToExcelManager, SaveToExcelManager>();
builder.Services.AddTransient<AbstractSaveToWordManager, SaveToWordManager>();
builder.Services.AddTransient<AbstractSaveToPdfManager, SaveToPdfManager>();
builder.Services.AddTransient<AbstractSaveToExcelMaster, SaveToExcelMaster>();
builder.Services.AddTransient<AbstractSaveToWordMaster, SaveToWordMaster>();
builder.Services.AddTransient<AbstractSaveToPdfMaster, SaveToPdfMaster>();
// Add services to the container.
builder.Services.AddControllersWithViews();
var app = builder.Build();
// Configure the HTTP request pipeline.
if (!app.Environment.IsDevelopment())
{
app.UseExceptionHandler("/Home/Error");
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
app.UseHsts();
}
app.UseHttpsRedirection();
app.UseStaticFiles();
app.UseRouting();
app.UseAuthorization();
app.MapControllerRoute(
name: "default",
pattern: "{controller=Home}/{action=Index}/{id?}");
app.Run();