ISEbd-22_CourseWork_University/University/UniversityEmpoyeeApp/Program.cs
2024-04-29 18:18:46 +04:00

44 lines
1.3 KiB
C#

using UniversityBusinessLogics.BusinessLogic;
using UniversityContracts.BusinessLogicContracts;
using UniversityContracts.StoragesContracts;
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddControllersWithViews();
builder.Services.AddSession(); // Äîáàâëÿåì ñåññèþ äëÿ àâòîðèçàöèè
builder.Services.AddTransient<IEmployeeLogic, EmployeeLogic>();
builder.Services.AddTransient<IClassLogic, ClassLogic>();
builder.Services.AddTransient<ICostLogic, CostLogic>();
builder.Services.AddTransient<IPurchaseLogic, PurchaseLogic>();
builder.Services.AddTransient<IPaymentLogic, PaymentLogic>();
builder.Services.AddTransient<IEmployeeStorage, EmployeeStorage>();
builder.Services.AddTransient<IClassStorage, ClassStorage>();
builder.Services.AddTransient<ICostStorage, CostStorage>();
builder.Services.AddTransient<IPurchaseStorage, PurchaseStorage>();
builder.Services.AddTransient<IPaymentStorage, PaymentStorage>();
var app = builder.Build();
// Configure the HTTP request pipeline.
if (!app.Environment.IsDevelopment())
{
app.UseExceptionHandler("/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.MapRazorPages();
app.Run();