Persistord.Adapters.NetCord 1.0.0-beta.3

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

Persistord.Adapters.NetCord

<div align="center">

NuGet Downloads

← Persistord docs · Documentation site

</div>

Opt-in NetCord adapter for Persistord: extension methods mapping NetCord model types to Persistord entities.

The core Persistord packages never reference a Discord client library. Install this package only if your bot uses NetCord.

Install

dotnet add package Persistord.Adapters.NetCord

API

using Persistord.Adapters.NetCord;
using Persistord.History.Entities;

db.Messages.Add(message.ToMessageEntity());   // embeds, attachments, reactions included
db.MessageHistory.Add(message.ToHistoryEntity(HistoryChangeType.Created));
await db.SaveChangesAsync();
Method Binds to Produces
ToGuildEntity() RestGuild GuildEntity
ToChannelEntity() IGuildChannel ChannelEntity
ToUserEntity() User UserEntity
ToMemberEntity() GuildUser MemberEntity
ToRoleEntity() Role RoleEntity
ToMessageEntity() RestMessage MessageEntity
ToHistoryEntity(changeType) RestMessage MessageHistoryEntity

Each mapper binds the base type that both the gateway and REST variants derive from, so Gateway.Guild and Gateway.Message map through the same methods as their Rest* counterparts.

What the mappers do not touch

Mappers are pure functions over data fields. They never set IsDeleted/DeletedAt, never set EF-generated surrogate keys (Embed.Id, ReactionEntity.Id), and never set child foreign keys — children are added to the parent's navigation collection and EF fills the keys on save. GuildEntity.JoinedAt/LeftAt are also left alone: they track your bot's membership lifecycle, which your persistence logic owns.

Channel types

NetCord expresses a channel's kind through its class rather than a property, and Persistord's ChannelType has four members, so the translation collapses NetCord's channel classes:

NetCord class ChannelType
PublicGuildThread, PrivateGuildThread, AnnouncementGuildThread, ForumGuildThread Thread
VoiceGuildChannel, StageGuildChannel Voice
CategoryGuildChannel Category
TextGuildChannel, AnnouncementGuildChannel, ForumGuildChannel, MediaForumGuildChannel, DirectoryGuildChannel Text

Unrecognised channel classes fall back to Text rather than throwing, so a future NetCord channel kind will not break a running bot.

Versioning

This package references NetCord as [1.0.0-beta.19, 2.0.0) — a floor, not a pin. The shipped assembly is compiled against 1.0.0-beta.19; NuGet resolves a range to its lowest satisfying version, and a consumer's newer direct reference wins.

NetCord has no stable release. Every published version is a prerelease, so this adapter carries a prerelease dependency. A local dotnet pack with no version override fails today with NU5104 (stable package with a prerelease dependency): Directory.Build.props sets a local-build placeholder <Version>1.0.0</Version>, which NuGet reads as stable, and the repo's TreatWarningsAsErrors turns that mismatch into a hard pack failure. Prerelease releases are unaffected — CD.yml packs with -p:Version=$VERSION, and release tags are themselves prerelease (1.0.0-beta4 and the like), so the stable/prerelease mismatch never arises there. To pack locally, pass a prerelease version explicitly: dotnet pack -p:Version=1.0.0-beta.1. When Persistord genuinely publishes a stable 1.0.0, this becomes a real release blocker to resolve then — either by waiting for NetCord 1.0.0 stable or by shipping this adapter on its own prerelease track — rather than by suppressing the warning.

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.0-beta.3 71 9/10/2026