2024-05-29 17:52:23 +04:00
|
|
|
using ComputerShopBusinessLogic.BusinessLogics;
|
|
|
|
using ComputerShopBusinessLogic.OfficePackage;
|
|
|
|
using ComputerShopBusinessLogic.OfficePackage.Implements;
|
|
|
|
using ComputerShopContracts.BusinessLogicContracts;
|
|
|
|
using ComputerShopContracts.StorageContracts;
|
|
|
|
using ComputerShopDatabaseImplement.Implements;
|
2024-05-28 13:22:24 +04:00
|
|
|
using ComputerShopGuarantorApp;
|
|
|
|
|
|
|
|
var Builder = WebApplication.CreateBuilder(args);
|
2024-05-02 00:13:15 +04:00
|
|
|
|
2024-05-29 17:52:23 +04:00
|
|
|
//Builder.Services.AddTransient<IUserStorage, UserStorage>();
|
|
|
|
Builder.Services.AddTransient<IComponentStorage, ComponentStorage>();
|
|
|
|
|
|
|
|
Builder.Services.AddTransient<IReportGuarantorLogic, ReportGuarantorLogic>();
|
|
|
|
Builder.Services.AddTransient<AbstractSaveToWordGuarantor, SaveToWordGuarantor>();
|
|
|
|
Builder.Services.AddTransient<AbstractSaveToExcelGuarantor, SaveToExcelGuarantor>();
|
|
|
|
Builder.Services.AddTransient<AbstractSaveToPdfGuarantor, SaveToPdfGuarantor>();
|
|
|
|
|
2024-05-02 00:13:15 +04:00
|
|
|
// Add services to the container.
|
2024-05-28 13:22:24 +04:00
|
|
|
Builder.Services.AddControllersWithViews();
|
2024-05-02 00:13:15 +04:00
|
|
|
|
2024-05-28 13:22:24 +04:00
|
|
|
var App = Builder.Build();
|
|
|
|
ApiUser.Connect(Builder.Configuration);
|
2024-05-02 00:13:15 +04:00
|
|
|
|
|
|
|
// Configure the HTTP request pipeline.
|
2024-05-28 13:22:24 +04:00
|
|
|
if (!App.Environment.IsDevelopment())
|
2024-05-02 00:13:15 +04:00
|
|
|
{
|
2024-05-28 13:22:24 +04:00
|
|
|
App.UseExceptionHandler("/Home/Error");
|
2024-05-02 00:13:15 +04:00
|
|
|
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
|
2024-05-28 13:22:24 +04:00
|
|
|
App.UseHsts();
|
2024-05-02 00:13:15 +04:00
|
|
|
}
|
|
|
|
|
2024-05-28 13:22:24 +04:00
|
|
|
App.UseHttpsRedirection();
|
|
|
|
App.UseStaticFiles();
|
|
|
|
App.UseRouting();
|
|
|
|
App.UseAuthorization();
|
2024-05-02 00:13:15 +04:00
|
|
|
|
2024-05-28 13:22:24 +04:00
|
|
|
App.MapControllerRoute(
|
2024-05-02 00:13:15 +04:00
|
|
|
name: "default",
|
|
|
|
pattern: "{controller=Home}/{action=Index}/{id?}");
|
|
|
|
|
2024-05-28 13:22:24 +04:00
|
|
|
App.Run();
|