2024-05-23 20:02:34 +04:00
|
|
|
using BusinessLogic.BusinessLogic;
|
2024-04-28 21:35:19 +04:00
|
|
|
using Contracts.BusinessLogicsContracts;
|
2024-05-23 20:02:34 +04:00
|
|
|
using Contracts.StoragesContracts;
|
|
|
|
using DatabaseImplement.Implements;
|
|
|
|
using ImplementerApp;
|
2024-04-28 17:11:40 +04:00
|
|
|
|
|
|
|
var builder = WebApplication.CreateBuilder(args);
|
|
|
|
|
2024-04-28 21:35:19 +04:00
|
|
|
builder.Services.AddControllersWithViews().AddRazorRuntimeCompilation();
|
2024-04-28 17:11:40 +04:00
|
|
|
|
2024-05-23 20:02:34 +04:00
|
|
|
builder.Logging.SetMinimumLevel(LogLevel.Trace);
|
|
|
|
builder.Logging.AddLog4Net("log4net.config");
|
|
|
|
|
|
|
|
builder.Services.AddTransient<IImplementerStorage, ImplementerStorage>();
|
|
|
|
builder.Services.AddTransient<IDetailStorage, DetailStorage>();
|
|
|
|
builder.Services.AddTransient<IProductStorage, ProductStorage>();
|
|
|
|
builder.Services.AddTransient<IProductionStorage, ProductionStorage>();
|
|
|
|
builder.Services.AddTransient<IImplementerLogic, ImplementerLogic>();
|
|
|
|
builder.Services.AddTransient<IDetailLogic, DetailLogic>();
|
|
|
|
builder.Services.AddTransient<IProductionLogic, ProductionLogic>();
|
|
|
|
builder.Services.AddTransient<IProductLogic, ProductLogic>();
|
|
|
|
builder.Services.AddTransient<ImplementerData>();
|
|
|
|
|
|
|
|
|
2024-04-28 17:11:40 +04:00
|
|
|
var app = builder.Build();
|
|
|
|
|
|
|
|
if (!app.Environment.IsDevelopment())
|
|
|
|
{
|
2024-04-28 21:35:19 +04:00
|
|
|
app.UseExceptionHandler("/Home/Error");
|
|
|
|
app.UseHsts();
|
2024-04-28 17:11:40 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
app.UseHttpsRedirection();
|
|
|
|
app.UseStaticFiles();
|
|
|
|
|
|
|
|
app.UseRouting();
|
|
|
|
|
|
|
|
app.UseAuthorization();
|
|
|
|
|
|
|
|
app.MapControllerRoute(
|
2024-04-28 21:35:19 +04:00
|
|
|
name: "default",
|
|
|
|
pattern: "{controller=Home}/{action=Index}/{id?}");
|
2024-04-28 17:11:40 +04:00
|
|
|
|
2024-04-28 21:35:19 +04:00
|
|
|
app.Run();
|