34 lines
872 B
C#
34 lines
872 B
C#
using EventVisitorDatabase;
|
|
using EventVisitorDatabase.Implements;
|
|
using EventVisitorLogic.StoragesContracts;
|
|
using Microsoft.EntityFrameworkCore;
|
|
var builder = WebApplication.CreateBuilder(args);
|
|
|
|
// Add services to the container.
|
|
|
|
builder.Services.AddControllers();
|
|
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
|
|
builder.Services.AddEndpointsApiExplorer();
|
|
builder.Services.AddSwaggerGen();
|
|
|
|
builder.Services.AddTransient<IEventStorage, EventStorage>();
|
|
builder.Services.AddTransient<IVisitorStorage, VisitorStorage>();
|
|
builder.Services.AddTransient<IOrganizerStorage, OrganizerStorage>();
|
|
|
|
var app = builder.Build();
|
|
|
|
// Configure the HTTP request pipeline.
|
|
if (app.Environment.IsDevelopment())
|
|
{
|
|
app.UseSwagger();
|
|
app.UseSwaggerUI();
|
|
}
|
|
|
|
app.UseHttpsRedirection();
|
|
|
|
app.UseAuthorization();
|
|
|
|
app.MapControllers();
|
|
|
|
app.Run();
|