GuestLog - StayEntry detail view and improvements:

- Added detail view for StayEntries.
- Added button to delete StayEntries.
- Improve queries of StayEntries using a "query config" record.
- Enabled LazyLoading for all database relations. This will make easier to find cases where required relations aren't explicitly loaded.
This commit is contained in:
2026-08-17 21:28:26 +02:00
parent 3e0ef34f66
commit 67845e250f
15 changed files with 229 additions and 45 deletions
+12 -1
View File
@@ -1,6 +1,7 @@
using FluentValidation;
using Microsoft.AspNetCore.Localization;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Diagnostics;
using MudBlazor.Services;
using Somnia.GuestLog.Components;
using Somnia.GuestLog.Infrastructure;
@@ -17,7 +18,17 @@ var connectionStringGuestLog = builder.Configuration.GetConnectionString("DbSomn
?? throw new InvalidOperationException("Connection string 'DbSomniaGuestLog' not found.");
builder.Services.AddDbContextFactory<GuestLogContext>(options =>
{
options.UseNpgsql(connectionStringGuestLog);
options.UseNpgsql(connectionStringGuestLog)
.UseLazyLoadingProxies()
.ConfigureWarnings(w => w.Log((CoreEventId.NavigationLazyLoading, LogLevel.Warning)));
// The following options help with debugging, but should
// be changed or removed for production.
if (builder.Environment.IsDevelopment())
{
options.EnableSensitiveDataLogging()
.EnableDetailedErrors();
}
});
builder.Services.AddDatabaseDeveloperPageExceptionFilter();