Lyo.Email.Postgres 1.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package Lyo.Email.Postgres --version 1.0.0
                    
NuGet\Install-Package Lyo.Email.Postgres -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Lyo.Email.Postgres" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Lyo.Email.Postgres" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Lyo.Email.Postgres" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Lyo.Email.Postgres --version 1.0.0
                    
#r "nuget: Lyo.Email.Postgres, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Lyo.Email.Postgres@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Lyo.Email.Postgres&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Lyo.Email.Postgres&version=1.0.0
                    
Install as a Cake Tool

Lyo.Email.Postgres

PostgreSQL schema and EmailDbContext for logging emails sent by Lyo.Email. This package does not subscribe to EmailService events — consumers handle the mapping and insertion (e.g. from the EmailSent / BulkEmailSent events) into the tables exposed here.

Examples

DI extensions

services.AddEmailDbContextFactoryFromConfiguration(builder.Configuration);
// or
services.AddEmailDbContextFactory(opts =>
{
    opts.ConnectionString = "Host=...;Database=...;Username=...;Password=...";
    opts.EnableAutoMigrations = true;
});

What ships

  • EmailDbContext — EF Core context with DbSet<EmailLogEntity> (email_logs) and DbSet<EmailAttachmentLogEntity> (email_attachment_logs). Default schema is email. SaveChanges sets CreatedTimestamp on insert and UpdatedTimestamp on update for both entities.
  • EmailDbContextFactory — design-time factory used by the EF Core tooling.
  • EmailLogEntity — sender, recipients (as JSON), subject, success flag, SMTP message, error message, provider MessageId, and audit timestamps. Attachment bytes are not stored here.
  • EmailAttachmentLogEntity — attachment metadata only (file name, optional FileStorageId, TemplateId, ContentType, MetadataJson, SortOrder) keyed back to an EmailLogEntity.
  • PostgresEmailOptionsIPostgresMigrationConfig implementation. Section name is PostgresEmail; default schema is email; EnableAutoMigrations defaults to false.

DI extensions

All extensions hang off IServiceCollection:

Extension Description
AddEmailDbContext(string connectionString) Registers an IDbContextFactory<EmailDbContext> plus a scoped EmailDbContext resolved from the factory.
AddEmailDbContext(Action<DbContextOptionsBuilder> configure) Registers EmailDbContext using a caller-supplied options builder (no factory).
AddEmailDbContextFactory(PostgresEmailOptions options) Registers IDbContextFactory<EmailDbContext> against options.ConnectionString with the email migrations history schema, plus Lyo.Postgres migration runner support.
AddEmailDbContextFactory(Action<PostgresEmailOptions> configure) Same as above with an inline configuration callback.
AddEmailDbContextFactoryFromConfiguration(IConfiguration configuration, string configSectionName = PostgresEmailOptions.SectionName) Binds PostgresEmailOptions from configuration (section defaults to PostgresEmail) and registers the factory.

Target frameworks

netstandard2.0;net10.0

Dependencies

Generated from ProjectReference / PackageReference (same model as docs/Lyo.ProjectGraph.html).

  • Lyo.Exceptions — (direct, lyo)
  • Lyo.Postgres — (direct, lyo)
  • Microsoft.Extensions.Configuration.Binder 10.0.5 — (direct, microsoft)
  • Microsoft.EntityFrameworkCore 10.0.5 — (transitive, microsoft)
  • Microsoft.EntityFrameworkCore.Design 10.0.5 — (transitive, microsoft)
  • Microsoft.EntityFrameworkCore.Relational 10.0.5 — (transitive, microsoft)
  • Microsoft.Extensions.Hosting.Abstractions 10.0.5 — (transitive, microsoft)
  • Microsoft.Extensions.Options 10.0.5 — (transitive, microsoft)
  • Npgsql.EntityFrameworkCore.PostgreSQL 10.0.3 — (transitive, third-party)
Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.1 28 8/18/2026
1.0.0 72 8/16/2026