Lyo.ContactUs.Postgres
1.0.9
dotnet add package Lyo.ContactUs.Postgres --version 1.0.9
NuGet\Install-Package Lyo.ContactUs.Postgres -Version 1.0.9
<PackageReference Include="Lyo.ContactUs.Postgres" Version="1.0.9" />
<PackageVersion Include="Lyo.ContactUs.Postgres" Version="1.0.9" />
<PackageReference Include="Lyo.ContactUs.Postgres" />
paket add Lyo.ContactUs.Postgres --version 1.0.9
#r "nuget: Lyo.ContactUs.Postgres, 1.0.9"
#:package Lyo.ContactUs.Postgres@1.0.9
#addin nuget:?package=Lyo.ContactUs.Postgres&version=1.0.9
#tool nuget:?package=Lyo.ContactUs.Postgres&version=1.0.9
Lyo.ContactUs.Postgres
PostgreSQL + EF Core implementation of Lyo.ContactUs.IContactUsService (PostgresContactUsService) via ContactUsDbContext, PostgresContactUsOptions, and AddPostgresMigrations<ContactUsDbContext, PostgresContactUsOptions> so the host can apply schema upgrades on startup.
What ships
ContactUsDbContext+ContactUsDbContextFactoryunderDatabase/, with a singleDbSet<ContactSubmissionEntity>(name / email / subject / message / phone / company / created timestamp; lengths mirrorContactUsRequest).PostgresContactUsService.ContactUsServiceBasesubclass that persists each submission via the registeredIDbContextFactory<ContactUsDbContext>, logs the new id, and implementsTestConnectionAsyncby issuingDatabase.CanConnectAsync(...).PostgresContactUsOptions(SectionName = "PostgresContactUs",Schema = "contact",ConnectionString,EnableAutoMigrations).InitialCreatemigration underMigrations/.
DI registration (Extensions)
| Entry point | What it does |
|---|---|
AddContactUsDbContext(string connectionString) |
Registers the DbContext factory plus a scoped ContactUsDbContext resolved from the factory (handy for ad-hoc EF code). |
AddContactUsDbContext(Action<DbContextOptionsBuilder>) |
Bare AddDbContext<ContactUsDbContext>(...) bring your own provider configuration. |
AddContactUsDbContextFactory(Action<PostgresContactUsOptions>) (plus (options) and FromConfiguration overloads) |
Registers IOptions<PostgresContactUsOptions>, AddPostgresMigrations<ContactUsDbContext, PostgresContactUsOptions>(), and IDbContextFactory<ContactUsDbContext> (UseNpgsql + migrations history under the contact schema). |
AddContactUsPostgres(Action<PostgresContactUsOptions>) (plus (options) and FromConfiguration overloads) |
Calls AddContactUsDbContextFactory(...), ensures a ContactUsServiceOptions singleton exists (defaults if not provided), and registers IContactUsService → scoped PostgresContactUsService. |
AddContactUsPostgres(...) is the one-stop registration for most callers. Use AddContactUsDbContextFactory(...) plus your own service registration when you want to wrap or
decorate the service yourself.
Schema
| Column | Source |
|---|---|
Id (PK, Guid) |
Generated in PostgresContactUsService.SubmitCoreAsync. |
Name, Email, Subject, Message, Phone, Company |
Copied verbatim from the validated ContactUsRequest. |
CreatedTimestamp |
DateTime.UtcNow at insert time. |
Migrations history is tracked in __EFMigrationsHistory under the contact schema configured on PostgresContactUsOptions.Schema.
Dependencies
Generated from ProjectReference / PackageReference (same model as docs/Lyo.ProjectGraph.html).
Lyo.ContactUs(direct, lyo)Lyo.Exceptions(direct, lyo)Lyo.Postgres(direct, lyo)Microsoft.EntityFrameworkCore10.0.5(direct, microsoft)Microsoft.EntityFrameworkCore.Design10.0.5(direct, microsoft)Microsoft.Extensions.Configuration.Binder10.0.5(direct, microsoft)Microsoft.Extensions.Options10.0.5(direct, microsoft)Lyo.Common(transitive, lyo)Lyo.Result(transitive, lyo)Microsoft.EntityFrameworkCore.Relational10.0.5(transitive, microsoft)Microsoft.Extensions.DependencyInjection.Abstractions10.0.5(transitive, microsoft)Microsoft.Extensions.Hosting.Abstractions10.0.5(transitive, microsoft)Microsoft.Extensions.Logging.Abstractions10.0.5(transitive, microsoft)Microsoft.Extensions.Options.ConfigurationExtensions10.0.5(transitive, microsoft)Npgsql.EntityFrameworkCore.PostgreSQL10.0.3(transitive, third-party)System.Memory4.6.3(transitive, microsoft, netstandard2.0)System.Text.Json10.0.5(transitive, microsoft, netstandard2.0)
| 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
- Lyo.ContactUs (>= 1.0.9)
- Lyo.Exceptions (>= 1.0.9)
- Lyo.Postgres (>= 1.0.9)
- Microsoft.EntityFrameworkCore (>= 10.0.5)
- Microsoft.Extensions.Configuration.Binder (>= 10.0.5)
- Microsoft.Extensions.Options (>= 10.0.5)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.