PIbd-22_KalyshevYV_Dozorova.../FurnitureAssembly/FurnitureAssemblyRestApi/Program.cs

64 lines
2.5 KiB
C#
Raw Normal View History

using FurnitureAssemblyBusinessLogic.BusinessLogics;
2023-05-17 04:29:22 +04:00
using FurnitureAssemblyBusinessLogic.OfficePackage.Implements;
using FurnitureAssemblyBusinessLogic.OfficePackage;
using FurnitureAssemblyContracts.BusinessLogicContracts;
using FurnitureAssemblyContracts.StorageContracts;
using FurnitureAssemblyDatabaseImplement.Implements;
using Microsoft.OpenApi.Models;
var builder = WebApplication.CreateBuilder(args);
builder.Logging.SetMinimumLevel(LogLevel.Trace);
builder.Logging.AddLog4Net("log4net.config");
// Add services to the container.
builder.Services.AddTransient<IFurnitureModuleStorage, FurnitureModuleStorage>();
builder.Services.AddTransient<IFurnitureStorage, FurnitureStorage>();
builder.Services.AddTransient<IMaterialStorage, MaterialStorage>();
builder.Services.AddTransient<IOrderStorage, OrderStorage>();
builder.Services.AddTransient<IOrderInfoStorage, OrderInfoStorage>();
builder.Services.AddTransient<IRoleStorage, RoleStorage>();
builder.Services.AddTransient<IScopeStorage, ScopeStorage>();
builder.Services.AddTransient<ISetStorage, SetStorage>();
builder.Services.AddTransient<IUserStorage, UserStorage>();
builder.Services.AddTransient<IFurnitureModuleLogic, FurnitureModuleLogic>();
builder.Services.AddTransient<IFurnitureLogic, FurnitureLogic>();
builder.Services.AddTransient<IMaterialLogic, MaterialLogic>();
builder.Services.AddTransient<IOrderLogic, OrderLogic>();
builder.Services.AddTransient<IOrderInfoLogic, OrderInfoLogic>();
builder.Services.AddTransient<IRoleLogic, RoleLogic>();
builder.Services.AddTransient<IScopeLogic, ScopeLogic>();
builder.Services.AddTransient<ISetLogic, SetLogic>();
builder.Services.AddTransient<IUserLogic, UserLogic>();
2023-05-17 04:29:22 +04:00
builder.Services.AddTransient<IReportWorkerLogic, ReportWorkerLogic>();
builder.Services.AddTransient<AbstractSaveToExcel, SaveToExcel>();
builder.Services.AddTransient<AbstractSaveToWord, SaveToWord>();
builder.Services.AddTransient<AbstractSaveToPdf, SaveToPdf>();
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 = "BlacksmithWorkshopRestApi", 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", "AbstractShopRestApi v1"));
}
app.UseHttpsRedirection();
app.UseAuthorization();
app.MapControllers();
app.Run();