PIBD-21_CousrWork_TourFirm_.../TourCompanyClientApp/Program.cs
2023-05-25 00:52:52 +04:00

51 lines
2.1 KiB
C#

using TourCompanyBusinessLogic.BusinessLogics;
using TourCompanyBusinessLogic.OfficePackage;
using TourCompanyBusinessLogic.OfficePackage.Implements;
using TourCompanyClientApp;
using TourCompanyContracts.BusinessLogicsContracts;
using TourCompanyContracts.StoragesContracts;
using TourCompanyDatabaseImplement.Implements;
using TourCompanyDatabaseImplement.Models;
var builder = WebApplication.CreateBuilder(args);
// Add services to the container.
builder.Services.AddTransient<IUserStorage, UserStorage>();
builder.Services.AddTransient<ITourStorage, TourStorage>();
builder.Services.AddTransient<IExecurtionStorage, ExecurtionStorage>();
builder.Services.AddTransient<ITourGroupStorage, TourGroupStorage>();
builder.Services.AddTransient<IPlaceVisitStorage, PlaceVisitStorage>();
builder.Services.AddTransient<IGidStorage, GidStorage>();
builder.Services.AddTransient<ITripStorage, TripStorage>();
builder.Services.AddTransient<IUserLogic, UserLogic>();
builder.Services.AddTransient<ITourLogic, TourLogic>();
builder.Services.AddTransient<IExecurtionLogic, ExecurtionLogic>();
builder.Services.AddTransient<ITourGroupLogic, TourGroupLogic>();
builder.Services.AddTransient<IPlaceVisitLogic, PlaceVisitLogic>();
builder.Services.AddTransient<IGidLogic, GidLogic>();
builder.Services.AddTransient<ITripLogic,TripLogic>();
builder.Services.AddTransient<IReportLogic, ReportLogic>();
builder.Services.AddTransient<AbstractSaveToExcelUser, SaveToExcelUser>();
builder.Services.AddTransient<AbstractSaveToWordUser, SaveToWordUser>();
builder.Services.AddTransient<AbstractSaveToPdfUser, SaveToPdfUser>();
// 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();