PIbd-22_Fedorenko_Puchkina_.../LawFim/LawFirmGuarantorApp/Program.cs

63 lines
2.7 KiB
C#
Raw Normal View History

2024-05-30 12:13:54 +04:00
using LawFirmContracts.BusinessLogicContracts;
2024-05-01 20:47:42 +04:00
using LawFirmContracts.StoragesContracts;
using LawFirmDatabaseImplement.Implements;
using LawFirmGuarantorApp;
2024-05-30 12:13:54 +04:00
using LawFirmBusinessLogic.BusinessLogics;
using LawFirmBusinessLogic.OfficePackages;
using LawFirmBusinessLogic.MailWorker;
using LawFirmBusinessLogic.OfficePackages.Implements;
2024-05-01 20:47:42 +04:00
var builder = WebApplication.CreateBuilder(args);
//builder.Services.AddTransient<IConsultationStorage, ConsultationStorage>();
//builder.Services.AddTransient<IHearingStorage, HearingStorage>();
2024-05-30 12:13:54 +04:00
builder.Services.AddTransient<IReportLogic, ReportLogic>();
builder.Services.AddTransient<IClientStorage, ClientStorage>();
builder.Services.AddTransient<IHearingStorage, HearingStorage>();
builder.Services.AddTransient<IVisitStorage, VisitStorage>();
builder.Services.AddTransient<ICaseStorage, CaseStorage>();
builder.Services.AddTransient<IConsultationStorage, ConsultationStorage>();
builder.Services.AddTransient<ILawyerStorage, LawyerStorage>();
builder.Services.AddTransient<IExecutorLogic, ExecutorLogic>();
builder.Services.AddTransient<IGuarantorLogic, GuarantorLogic>();
builder.Services.AddTransient<IExecutorStorage, ExecutorStorage>();
builder.Services.AddTransient<IGuarantorStorage, GuarantorStorage>();
builder.Services.AddTransient<AbstractSaveToExcelClientsConsultation, SaveToExcelClientsConsultation>();
builder.Services.AddTransient<AbstractSaveToExcelVisitsLawyer, SaveToExcelVisitsLawyer>();
builder.Services.AddTransient<AbstractSaveToWordClientsConsultation, SaveToWordClientsConsultation>();
builder.Services.AddTransient<AbstractSaveToWordVisitsLawyer, SaveToWordVisitsLawyer>();
builder.Services.AddTransient<AbstractSaveToPdfConsultationHearing, SaveToPdfConsultationHearing>();
builder.Services.AddTransient<AbstractSaveToPdfCaseHearing, SaveToPdfCaseHearing>();
builder.Services.AddTransient<AbstractSaveToPdfClients, SaveToPdfClients>();
builder.Services.AddTransient<AbstractSaveToPdfClientCaseHearing, SaveToPdfClientCaseHearing>();
builder.Services.AddSingleton<AbstractMailWorker, MailKitWorker>();
// Add services to the container.
builder.Services.AddControllersWithViews();
var app = builder.Build();
APIClient.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=EnterGuarantor}/{id?}");
app.Run();