PIbd-21_Anisin_R.S._CourseW.../TravelAgency/TravelAgencyWebApp/Program.cs

42 lines
1.7 KiB
C#
Raw Normal View History

2024-05-28 18:32:51 +04:00
using TravelAgencyBusinessLogic.BusinessLogics;
using TravelAgencyContracts.BusinessLogicsContracts;
using TravelAgencyContracts.StoragesContracts;
using TravelAgencyDatabaseImplement.Implements;
2024-04-30 18:42:41 +04:00
var builder = WebApplication.CreateBuilder(args);
// Add services to the container.
builder.Services.AddControllersWithViews();
2024-05-28 18:32:51 +04:00
builder.Services.AddTransient<IUserStorage, UserStorage>();
builder.Services.AddTransient<ITourStorage, TourStorage>();
builder.Services.AddTransient<IExcursionStorage, ExcursionStorage>();
builder.Services.AddTransient<IExcursionGroupStorage, ExcursionGroupStorage>();
builder.Services.AddTransient<IGuideStorage, GuideStorage>();
builder.Services.AddTransient<IPlaceStorage, PlaceStorage>();
builder.Services.AddTransient<ITripStorage, TripStorage>();
builder.Services.AddTransient<IUserLogic, UserLogic>();
builder.Services.AddTransient<ITourLogic, TourLogic>();
builder.Services.AddTransient<IExcursionLogic, ExcursionLogic>();
builder.Services.AddTransient<IExcursionGroupLogic, ExcursionGroupLogic>();
builder.Services.AddTransient<IGuideLogic, GuideLogic>();
builder.Services.AddTransient<IPlaceLogic, PlaceLogic>();
builder.Services.AddTransient<ITripLogic, TripLogic>();
2024-04-30 18:42:41 +04:00
var app = builder.Build();
2024-05-28 18:32:51 +04:00
2024-04-30 18:42:41 +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();