SHA256
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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user