2024-04-29 17:27:20 +04:00
|
|
|
|
using UniversityBusinessLogics.BusinessLogic;
|
|
|
|
|
using UniversityContracts.BusinessLogicContracts;
|
|
|
|
|
using UniversityContracts.StoragesContracts;
|
2024-04-29 18:18:37 +04:00
|
|
|
|
using UniversityDatabaseImplement.Implements;
|
2024-04-29 17:27:20 +04:00
|
|
|
|
using Serilog;
|
|
|
|
|
|
2024-04-29 17:10:01 +04:00
|
|
|
|
var builder = WebApplication.CreateBuilder(args);
|
|
|
|
|
|
2024-04-29 17:27:20 +04:00
|
|
|
|
builder.Services.AddControllersWithViews();
|
|
|
|
|
builder.Services.AddSession(); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2024-04-29 17:10:01 +04:00
|
|
|
|
|
2024-04-29 17:27:20 +04:00
|
|
|
|
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>();
|
2024-04-29 17:10:01 +04:00
|
|
|
|
|
2024-04-29 18:18:37 +04:00
|
|
|
|
builder.Services.AddLogging(option =>
|
|
|
|
|
{
|
|
|
|
|
var configuration = new ConfigurationBuilder()
|
|
|
|
|
.SetBasePath(Directory.GetCurrentDirectory())
|
|
|
|
|
.AddJsonFile(path: "appsettings.json", optional: false, reloadOnChange: true)
|
|
|
|
|
.Build();
|
|
|
|
|
|
|
|
|
|
var logger = new LoggerConfiguration()
|
|
|
|
|
.ReadFrom.Configuration(configuration)
|
|
|
|
|
.CreateLogger();
|
|
|
|
|
|
|
|
|
|
option.AddSerilog(logger);
|
|
|
|
|
});
|
|
|
|
|
|
2024-04-29 17:27:20 +04:00
|
|
|
|
var app = builder.Build();
|
2024-04-29 17:10:01 +04:00
|
|
|
|
// 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();
|