Persistord.Messages 1.0.0-beta2

This is a prerelease version of Persistord.Messages.
dotnet add package Persistord.Messages --version 1.0.0-beta2
                    
NuGet\Install-Package Persistord.Messages -Version 1.0.0-beta2
                    
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="Persistord.Messages" Version="1.0.0-beta2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Persistord.Messages" Version="1.0.0-beta2" />
                    
Directory.Packages.props
<PackageReference Include="Persistord.Messages" />
                    
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 Persistord.Messages --version 1.0.0-beta2
                    
#r "nuget: Persistord.Messages, 1.0.0-beta2"
                    
#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 Persistord.Messages@1.0.0-beta2
                    
#: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=Persistord.Messages&version=1.0.0-beta2&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Persistord.Messages&version=1.0.0-beta2&prerelease
                    
Install as a Cake Tool

Persistord.Messages

<div align="center">

NuGet Downloads

← Persistord docs · Documentation site

</div>

Message-persistence module for Persistord. Depends on Persistord.Core.

Adds MessageEntity plus its related data and an ApplyMessagesModule() model extension:

protected override void OnModelCreating(ModelBuilder modelBuilder)
{
    base.OnModelCreating(modelBuilder);   // core skeleton + snowflake convention
    modelBuilder.ApplyMessagesModule();   // messages, embeds, attachments, reactions
}

Soft-delete

MessageEntity carries IsDeleted / DeletedAt. A delete is recorded, not removed, so dependent rows (e.g. history) keep a valid foreign key.

By default a global query filter hides soft-deleted messages:

modelBuilder.ApplyMessagesModule();             // filter ON (default)
modelBuilder.ApplyMessagesModule(filterDeleted: false);  // filter OFF

To read soft-deleted rows on a per-query basis while keeping the filter on, use the standard EF Core escape hatch:

var all = db.Messages.IgnoreQueryFilters().ToList();

Storage shape

  • Embeds are stored relationally as child rows (Embed, with owned EmbedFooter / EmbedAuthor and a relational EmbedField collection). Each embed and field has a surrogate key, which keeps the model portable across providers — including SQLite, where a JSON-document mapping is not the default. If you target a provider with strong JSON support and prefer document storage, e.ToJson() is available as a power-user opt-in, but it is not the default because owned-collection JSON support varies by provider.
  • Attachments and reactions are relational children with their own keys. AttachmentEntity.Id is the caller-supplied Discord snowflake (never store-generated); ReactionEntity.Id is a surrogate.

License

MIT

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 (3)

Showing the top 3 NuGet packages that depend on Persistord.Messages:

Package Downloads
Persistord

Meta package that bundles the library-neutral Persistord stack — Core, Messages, and History — in a single reference.

Persistord.History

Append-only message history module for Persistord, with a relational FK to MessageEntity.

Persistord.Adapters.DiscordNet

Discord.Net adapter for Persistord: extension methods mapping Discord.Net interface types to Persistord entities.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0-beta2 70 7/20/2026
1.0.0-beta.1 77 6/14/2026