Initial commit
This commit is contained in:
16
Program.cs
Normal file
16
Program.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using Workshop8.Data;
|
||||
using Workshop8.Infrastructure;
|
||||
using Workshop8.Models;
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
builder.Services.AddRazorPages();
|
||||
builder.Services.AddSingleton<IClientRepository, SqliteClientRepository>();
|
||||
builder.Services.AddSingleton<LogService>();
|
||||
builder.Services.AddSingleton<DbSelector>();
|
||||
var app = builder.Build();
|
||||
|
||||
await app.Services.GetRequiredService<DbSelector>().EnsureDatabasesAsync();
|
||||
|
||||
app.UseStaticFiles();
|
||||
app.MapRazorPages();
|
||||
await app.RunAsync();
|
Reference in New Issue
Block a user