presence/presence_api/Program.cs
Class_Student de13fb6245 admin
2024-11-20 12:15:21 +03:00

33 lines
803 B
C#

using data.RemoteData.RemoteDataBase;
var builder = WebApplication.CreateBuilder(args);
// Ðåãèñòðàöèÿ ñåðâèñîâ
builder.Services.AddControllers();
builder.Services.AddDbContext<RemoteDatabaseContext>();
// Ðåãèñòðèðóåì çàâèñèìîñòè äëÿ ðåïîçèòîðèåâ
builder.Services.ConfigurateAdminPanel();
builder.Services.ConfigurateRepositories();
// Ðåãèñòðèðóåì çàâèñèìîñòè äëÿ ãðóïïû, ïîëüçîâàòåëåé è ïîñåùàåìîñòè
builder.Services.ConfigurateGroup();
builder.Services.ConfigurateUser(); // Äîáàâëåíî
builder.Services.ConfiguratePresence(); // Äîáàâëåíî
builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen();
var app = builder.Build();
if (app.Environment.IsDevelopment())
{
app.UseSwagger();
app.UseSwaggerUI();
}
app.UseHttpsRedirection();
app.MapControllers();
app.Run();