Neuerstellung

This commit is contained in:
maier_st
2024-10-25 13:35:06 +02:00
parent 4ed5b535da
commit 689993b05a
2293 changed files with 288667 additions and 0 deletions

View File

@@ -0,0 +1,40 @@
using FSI.BT.IR.Organization.Db.Services;
using Microsoft.EntityFrameworkCore;
var builder = WebApplication.CreateBuilder(args);
// Add services to the container.
var connectionString = builder.Configuration.GetConnectionString("DefaultConnection") ?? throw new InvalidOperationException("Connection string 'DefaultConnection' not found.");
builder.Services.AddDbContext<FSI.BT.IR.Organization.Db.Data.AppDbContext>(options =>
options.UseSqlite(connectionString));
builder.Services.AddScoped<IOrganizationService, OrganizationService>();
// Add services to the container.
builder.Services.AddControllersWithViews();
var app = builder.Build();
// Configure the HTTP request pipeline.
if (!app.Environment.IsDevelopment())
{
app.UseExceptionHandler("/Home/Error");
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
app.UseHsts();
}
app.UseHttpsRedirection();
app.UseStaticFiles();
app.UseRouting();
app.UseAuthorization();
app.MapControllerRoute(
name: "default",
pattern: "{controller=Home}/{action=Index}/{id?}");
app.Run();