43 lines
1.3 KiB
C#
43 lines
1.3 KiB
C#
using UniversityBusinessLogics.BusinessLogic;
|
|
using UniversityContracts.BusinessLogicContracts;
|
|
using UniversityContracts.StoragesContracts;
|
|
|
|
|
|
using BankDatabaseImplement.Implements;
|
|
using Serilog;
|
|
|
|
var builder = WebApplication.CreateBuilder(args);
|
|
|
|
builder.Services.AddControllersWithViews();
|
|
builder.Services.AddSession(); // Äîáàâëÿåì ñåññèþ äëÿ àâòîðèçàöèè
|
|
|
|
builder.Services.AddTransient<IClientLogic, ClientLogic>();
|
|
builder.Services.AddTransient<IPurchaseLogic, PurchaseLogic>();
|
|
builder.Services.AddTransient<IClassLogic, ClassLogic>();
|
|
builder.Services.AddTransient<IPaymentLogic, PaymentLogic>();
|
|
|
|
builder.Services.AddTransient<IClientStorage, ClientStorage>();
|
|
builder.Services.AddTransient<IPurchaseStorage, PurchaseStorage>();
|
|
builder.Services.AddTransient<IClassStorage, ClassStorage>();
|
|
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();
|