Coursach/Course/ImplementerApp/Program.cs

44 lines
1.3 KiB
C#

using BusinessLogic.BusinessLogic;
using Contracts.BusinessLogicsContracts;
using Contracts.StoragesContracts;
using DatabaseImplement.Implements;
using ImplementerApp;
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddControllersWithViews().AddRazorRuntimeCompilation();
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>();
var app = builder.Build();
if (!app.Environment.IsDevelopment())
{
app.UseExceptionHandler("/Home/Error");
app.UseHsts();
}
app.UseHttpsRedirection();
app.UseStaticFiles();
app.UseRouting();
app.UseAuthorization();
app.MapControllerRoute(
name: "default",
pattern: "{controller=Home}/{action=Index}/{id?}");
app.Run();