37 lines
1.1 KiB
C#
37 lines
1.1 KiB
C#
|
using SushiBarBusinessLogic.BusinessLogics;
|
||
|
using SushiBarContracts.BusinessLogicsContracts;
|
||
|
using SushiBarContracts.StoragesContracts;
|
||
|
using SushiBarDatabaseImplement.Implements;
|
||
|
var builder = WebApplication.CreateBuilder(args);
|
||
|
|
||
|
builder.Logging.SetMinimumLevel(LogLevel.Information);
|
||
|
builder.Logging.AddLog4Net("log4net.config");
|
||
|
|
||
|
// Add services to the container.
|
||
|
builder.Services.AddSingleton<IClientStorage, ClientStorage>();
|
||
|
builder.Services.AddSingleton<IOrderStorage, OrderStorage>();
|
||
|
builder.Services.AddSingleton<ISushiStorage, SushiStorage>();
|
||
|
builder.Services.AddSingleton<IOrderLogic, OrderLogic>();
|
||
|
builder.Services.AddSingleton<IClientLogic, ClientLogic>();
|
||
|
builder.Services.AddSingleton<ISushiLogic, SushiLogic>();
|
||
|
builder.Services.AddControllers();
|
||
|
|
||
|
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
|
||
|
builder.Services.AddEndpointsApiExplorer();
|
||
|
builder.Services.AddSwaggerGen();
|
||
|
|
||
|
var app = builder.Build();
|
||
|
|
||
|
// Configure the HTTP request pipeline.
|
||
|
if (app.Environment.IsDevelopment())
|
||
|
{
|
||
|
app.UseSwagger();
|
||
|
app.UseSwaggerUI();
|
||
|
}
|
||
|
|
||
|
app.UseAuthorization();
|
||
|
|
||
|
app.MapControllers();
|
||
|
|
||
|
app.Run();
|