AndreGoepel.Marten.Configuration
1.1.0
dotnet add package AndreGoepel.Marten.Configuration --version 1.1.0
NuGet\Install-Package AndreGoepel.Marten.Configuration -Version 1.1.0
<PackageReference Include="AndreGoepel.Marten.Configuration" Version="1.1.0" />
<PackageVersion Include="AndreGoepel.Marten.Configuration" Version="1.1.0" />
<PackageReference Include="AndreGoepel.Marten.Configuration" />
paket add AndreGoepel.Marten.Configuration --version 1.1.0
#r "nuget: AndreGoepel.Marten.Configuration, 1.1.0"
#:package AndreGoepel.Marten.Configuration@1.1.0
#addin nuget:?package=AndreGoepel.Marten.Configuration&version=1.1.0
#tool nuget:?package=AndreGoepel.Marten.Configuration&version=1.1.0
AndreGoepel.Marten.Configuration
Small, singleton admin-configured settings records stored as Marten documents, sharing one physical table instead of each settings type getting its own one-row table.
Why
Apps often need a handful of admin-editable settings sections (email server, feature flags, cleanup schedules, ...). Each one is logically a single row: load it, show it in a form, save it back. This package gives that shape a common base so every settings type doesn't need its own hand-rolled Marten load/save boilerplate.
Usage
public sealed class EmailSettingsDocument : SettingsDocument, ISettingsDocument<EmailSettingsDocument>
{
public static string DocumentId => "email-settings";
public required string SenderEmail { get; init; }
}
Register the document type and the store during startup:
builder.Services.AddMartenConfiguration();
builder.Services.AddMarten(options =>
{
options.Connection(connectionString);
options.AddSettingsDocument<EmailSettingsDocument>();
});
Read and write it through ISettingsStore:
var settings = await settingsStore.LoadAsync<EmailSettingsDocument>(cancellationToken);
await settingsStore.SaveAsync(
new EmailSettingsDocument { SenderEmail = "noreply@example.com" },
cancellationToken
);
LoadAsync reads fresh from Postgres on every call (no caching), so a saved change takes effect on the next request without an application restart. SaveAsync sets Id to the type's DocumentId for you, so callers never need to remember it.
Every settings type registered via AddSettingsDocument<T>() shares Marten's document-hierarchy subclass mapping under SettingsDocument, so they all live in one physical table (mt_doc_settingsdocument) rather than proliferating one-row tables.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Marten (>= 9.19.0)
- Microsoft.AspNetCore.DataProtection.Abstractions (>= 10.0.10)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.10)
NuGet packages (5)
Showing the top 5 NuGet packages that depend on AndreGoepel.Marten.Configuration:
| Package | Downloads |
|---|---|
|
AndreGoepel.Marten.Identity
ASP.NET Core Identity stores backed by Marten (PostgreSQL). Provides user, role, and user-role stores, middleware, and DI extensions. |
|
|
AndreGoepel.Marten.Identity.Blazor
Blazor Server UI components for AndreGoepel.Marten.Identity — login, registration, 2FA, passkeys, and user/role administration pages built with Radzen. |
|
|
AndreGoepel.AppFoundation.MailService
Email sending for AndreGoepel.AppFoundation: Wolverine message handler + MailKit SMTP sender with a durable Marten outbox. |
|
|
AndreGoepel.AppFoundation
Reusable Blazor management frontend (layout, navigation, setup, and admin shell) for AndreGoepel.AppFoundation-based applications. |
|
|
AndreGoepel.AppFoundation.Hosting
One-call backend seam (AddAppFoundation / UseAppFoundation) wiring Marten, identity, Wolverine messaging, email, data protection, and the request pipeline for AndreGoepel.AppFoundation hosts. |
GitHub repositories
This package is not used by any popular GitHub repositories.