mirror of
https://github.com/aaronpo97/the-biergarten-app.git
synced 2026-02-16 20:13:49 +00:00
25 lines
731 B
C#
25 lines
731 B
C#
using BusinessLayer.Services;
|
|
using DataAccessLayer.Repositories;
|
|
using DataAccessLayer.Sql;
|
|
|
|
var builder = WebApplication.CreateBuilder(args);
|
|
|
|
builder.Services.AddControllers();
|
|
builder.Services.AddEndpointsApiExplorer();
|
|
builder.Services.AddSwaggerGen();
|
|
builder.Services.AddOpenApi();
|
|
|
|
// Dependency Injection
|
|
builder.Services.AddSingleton<ISqlConnectionFactory, DefaultSqlConnectionFactory>();
|
|
builder.Services.AddScoped<IUserAccountRepository, UserAccountRepository>();
|
|
builder.Services.AddScoped<IUserService, UserService>();
|
|
var app = builder.Build();
|
|
|
|
app.UseSwagger();
|
|
app.UseSwaggerUI();
|
|
app.MapOpenApi();
|
|
|
|
app.UseHttpsRedirection();
|
|
app.MapControllers();
|
|
app.MapFallbackToController("Handle404", "NotFound");
|
|
app.Run(); |