CourseWork_CompShop/ComputerShopProvider/OrdererClientApp/Program.cs

50 lines
1.7 KiB
C#
Raw Normal View History

2023-12-01 19:59:06 +04:00
using ComputerShopBusinessLogic.BusinessLogics;
using ComputerShopBusinessLogic.OfficePackage;
using ComputerShopBusinessLogic.OfficePackage.Implements;
using ComputerShopContracts.BusinessLogicContracts;
using ComputerShopContracts.StorageContracts;
using ComputerShopDatabaseImplement.Implements;
using OrdererClientApp;
2023-05-17 14:20:02 +04:00
var builder = WebApplication.CreateBuilder(args);
2023-12-01 19:59:06 +04:00
builder.Services.AddTransient<IComponentStorage, ComponentStorage>();
builder.Services.AddTransient<ISupplyStorage, SupplyStorage>();
builder.Services.AddTransient<IAssemblyStorage, AssemblyStorage>();
builder.Services.AddTransient<IEquipmentReceivingStorage, EquipmentReceivingStorage>();
builder.Services.AddTransient<IPurchaseStorage, PurchaseStorage>();
builder.Services.AddTransient<IOrderStorage, OrderStorage>();
builder.Services.AddTransient<ClientStorage, ClientStorage>();
builder.Services.AddTransient<IReportLogic, ReportLogic>();
builder.Services.AddTransient<AbstractSaveToWord, SaveToWord>();
builder.Services.AddTransient<AbstractSaveToExcel, SaveToExcel>();
builder.Services.AddTransient<AbstractSaveToPdf, SaveToPdf>();
2023-05-17 14:20:02 +04:00
// Add services to the container.
builder.Services.AddControllersWithViews();
var app = builder.Build();
2023-12-01 19:59:06 +04:00
APIClient.Connect(builder.Configuration);
2023-05-17 14:20:02 +04:00
// 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();