PIbd-22_Chernyshev_Shabunov.../ComputerShopImplementerApp/Program.cs

60 lines
2.0 KiB
C#
Raw Permalink Normal View History

using ComputerShopBusinessLogic.BusinessLogics;
using ComputerShopContracts.BusinessLogicContracts;
using ComputerShopContracts.StorageContracts;
using ComputerShopDatabaseImplement.Implements;
using ComputerShopDatabaseImplement.Models;
using ComputerShopDataModels.Models;
using ComputerShopImplementerApp;
using ComputerShopBusinessLogic.OfficePackage;
using ComputerShopBusinessLogic.OfficePackage.Implements;
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddTransient<IUserStorage, UserStorage>();
builder.Services.AddTransient<IShipmentStorage, ShipmentStorage>();
builder.Services.AddTransient<IRequestStorage, RequestStorage>();
builder.Services.AddTransient<IOrderStorage, OrderStorage>();
2024-05-28 19:40:32 +04:00
builder.Services.AddTransient<IUserLogic, UserLogic>();
builder.Services.AddTransient<IShipmentLogic, ShipmentLogic>();
builder.Services.AddTransient<IRequestLogic, RequestLogic>();
builder.Services.AddTransient<IOrderLogic, OrderLogic>();
2024-05-28 19:40:32 +04:00
builder.Services.AddTransient<IAssemblyStorage, AssemblyStorage>();
2024-05-28 19:40:32 +04:00
builder.Services.AddTransient<IReportImplementerLogic, ReportImplementerLogic>();
builder.Services.AddTransient<AbstractSaveToWordImplementer, SaveToWordImplementer>();
builder.Services.AddTransient<AbstractSaveToExcelImplementer, SaveToExcelImplementer>();
builder.Services.AddTransient<AbstractSaveToPdfImplementer, SaveToPdfImplementer>();
2024-05-28 14:34:16 +04:00
// Add services to the container.
builder.Services.AddControllersWithViews();
var app = builder.Build();
APIUser.Connect(builder.Configuration);
// 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();