66 lines
2.1 KiB
C#
66 lines
2.1 KiB
C#
|
using HospitalBusinessLogic;
|
||
|
using HospitalContracts.BusinessLogicContracts;
|
||
|
using HospitalContracts.StorageContracts;
|
||
|
using HospitalDatabaseImplement.Implements;
|
||
|
using Microsoft.OpenApi.Models;
|
||
|
|
||
|
var builder = WebApplication.CreateBuilder(args);
|
||
|
|
||
|
// Add services to the container.
|
||
|
builder.Services.AddTransient<IApothecaryStorage, ApothecaryStorage>();
|
||
|
builder.Services.AddTransient<IMedicineStorage, MedicineStorage>();
|
||
|
builder.Services.AddTransient<IPrescriptionStorage, PrescriptionStorage>();
|
||
|
builder.Services.AddTransient<IRecipeStorage, RecipeStorage>();
|
||
|
|
||
|
builder.Services.AddTransient<IPatientStorage, PatientStorage>();
|
||
|
builder.Services.AddTransient<IProcedureStorage, ProcedureStorage>();
|
||
|
builder.Services.AddTransient<ITreatmentStorage, TreatmentStorage>();
|
||
|
|
||
|
builder.Services.AddTransient<IApothecaryLogic, ApothecaryLogic>();
|
||
|
builder.Services.AddTransient<IMedicineLogic, MedicineLogic>();
|
||
|
builder.Services.AddTransient<IPrescriptionLogic, PrescriptionLogic>();
|
||
|
builder.Services.AddTransient<IRecipeLogic, RecipeLogic>();
|
||
|
|
||
|
builder.Services.AddTransient<IProcedureLogic, ProcedureLogic>();
|
||
|
builder.Services.AddTransient<ITreatmentLogic, TreatmentLogic>();
|
||
|
|
||
|
builder.Services.AddTransient<IReportLogic, ReportLogic>();
|
||
|
|
||
|
//builder.Services.AddTransient<AbstractSaveToWord, SaveToWord>();
|
||
|
//builder.Services.AddTransient<AbstractSaveToExcel, SaveToExcel>();
|
||
|
//builder.Services.AddSingleton<AbstractMailWorker, MailKitWorker>();
|
||
|
|
||
|
builder.Services.AddControllers().AddJsonOptions((option) =>
|
||
|
{
|
||
|
option.JsonSerializerOptions.IncludeFields = true;
|
||
|
});
|
||
|
|
||
|
|
||
|
// 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 = "HospitalRestApi",
|
||
|
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",
|
||
|
"HospitalRestApi v1"));
|
||
|
}
|
||
|
app.UseHttpsRedirection();
|
||
|
|
||
|
app.UseAuthorization();
|
||
|
|
||
|
app.MapControllers();
|
||
|
|
||
|
app.Run();
|