61 lines
2.1 KiB
C#
Raw Normal View History

2024-05-26 16:27:14 +04:00
using Microsoft.OpenApi.Models;
using ServiceStationBusinessLogic.BusinessLogics;
2024-05-27 23:42:44 +04:00
using ServiceStationBusinessLogic.OfficePackage;
using ServiceStationBusinessLogic.OfficePackage.Implements;
2024-05-26 16:27:14 +04:00
using ServiceStationContracts.BusinessLogicsContracts;
using ServiceStationContracts.StoragesContracts;
using ServiceStationDatabaseImplement.Implements;
var builder = WebApplication.CreateBuilder(args);
// Add services to the container.
builder.Logging.SetMinimumLevel(LogLevel.Trace);
builder.Logging.AddLog4Net("log4net.config");
builder.Services.AddTransient<ICarStorage, CarStorage>();
builder.Services.AddTransient<IDefectStorage, DefectStorage>();
builder.Services.AddTransient<IExecutorStorage, ExecutorStorage>();
builder.Services.AddTransient<ITechnicalWorkStorage, TechnicalWorkStorage>();
builder.Services.AddTransient<IRepairStorage, RepairStorage>();
2024-05-27 23:44:36 +04:00
builder.Services.AddTransient<IWorkStorage, WorkStorage>();
2024-05-26 16:27:14 +04:00
builder.Services.AddTransient<ICarLogic, CarLogic>();
builder.Services.AddTransient<IDefectLogic, DefectLogic>();
builder.Services.AddTransient<IExecutorLogic, ExecutorLogic>();
builder.Services.AddTransient<ITechnicalWorkLogic, TechnicalWorkLogic>();
2024-05-27 23:38:51 +04:00
builder.Services.AddTransient<IExecutorReportLogic, ExecutorReportLogic>();
builder.Services.AddTransient<AbstractSaveToExcelExecutor, SaveToExcelExecutor>();
builder.Services.AddTransient<AbstractSaveToWordExecutor, SaveToWordExecutor>();
builder.Services.AddTransient<AbstractSaveToPdfExecutor, SaveToPdfExecutor>();
2024-05-26 16:27:14 +04:00
builder.Services.AddControllers();
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen(c =>
{
c.SwaggerDoc("v1", new OpenApiInfo
{
Title = "ServiceStation",
Version = "v1"
});
});
var app = builder.Build();
// Configure the HTTP request pipeline.
if (app.Environment.IsDevelopment())
{
app.UseSwagger();
app.UseSwaggerUI(c => c.SwaggerEndpoint("/swagger/v1/swagger.json", "ServiceStation v1"));
}
app.UseHttpsRedirection();
app.UseAuthorization();
app.MapControllers();
2024-05-27 23:44:36 +04:00
app.Run();