Zymergi.Social
11.4.0-alpha
dotnet add package Zymergi.Social --version 11.4.0-alpha
NuGet\Install-Package Zymergi.Social -Version 11.4.0-alpha
<PackageReference Include="Zymergi.Social" Version="11.4.0-alpha" />
<PackageVersion Include="Zymergi.Social" Version="11.4.0-alpha" />
<PackageReference Include="Zymergi.Social" />
paket add Zymergi.Social --version 11.4.0-alpha
#r "nuget: Zymergi.Social, 11.4.0-alpha"
#:package Zymergi.Social@11.4.0-alpha
#addin nuget:?package=Zymergi.Social&version=11.4.0-alpha&prerelease
#tool nuget:?package=Zymergi.Social&version=11.4.0-alpha&prerelease
Zymergi.Social
Social domain for Zymergi apps: users, groups, favorites, submissions, comments, their repository interfaces, and ISocialFacade, which loads a post or a group with its comment tree. This package has models and interfaces only.
Targets .NET 10. Depends on Zymergi.Core and Zymergi.Data. Zymergi.Identity.Auth0 depends on this package (Auth0IUserAdapter.FromSocial takes a User).
Install
dotnet add package Zymergi.Social
Register in Program.cs
The host supplies the implementations. The MariaDB repositories are in Zymergi.Social.MariaDb, which is not packed. If you write your own, base them on MariaRepositoryBase<T> from Zymergi.Data.MariaDb and give each one the connection factory:
using Zymergi.Data;
using Zymergi.Social;
builder.Services.AddDbConnectionFactory(builder.Configuration);
builder.Services.AddTransient<ICommentRepository>(sp =>
new MyCommentRepository(sp.GetRequiredService<IDbConnectionFactory>(), "app"));
builder.Services.AddTransient<IUserSubmissionRepository>(sp =>
new MySubmissionRepository(sp.GetRequiredService<IDbConnectionFactory>(), "app"));
builder.Services.AddScoped<ISocialFacade, MySocialFacade>();
Use it
app.MapGet("/posts/{handle}", async (string handle, ISocialFacade social, CancellationToken ct) =>
Results.Ok(await social.GetSubmissionProfileDtoAsync(handle, applyCommentHierarchy: true, ct)));
app.MapGet("/groups/{handle}", async (string handle, ISocialFacade social, CancellationToken ct) =>
Results.Ok(await social.GetGroupProfileDtoAsync(handle, cancellationToken: ct)));
In a service, depend on the narrow interface you need:
public sealed class CommentFeed(ICommentRepository comments)
{
public Task<IEnumerable<Comment>> ForPagesAsync(IEnumerable<string> pageHandles, CancellationToken ct) =>
comments.GetCommentsByPageAsync(pageHandles, ct); // one query for many pages
}
Best practices
- Depend on
ISocialFacadeor one repository interface, not on an implementation. - Data access follows the
Zymergi.DataREADME: a singletonIDbConnectionFactory, a connection per operation, async with the request'sCancellationToken, and parameterized SQL. - Load comments for many pages at once (
GetCommentsByPageAsync(IEnumerable<string>),LoadCommentsForUserSubmissionsAsync) instead of one query per post. - Page long lists, and cache public group and post pages (output caching or
HybridCache). - Treat user text as untrusted: render comment Markdown with
MarkdigRendererfromZymergi.Rendering. - Check that the signed-in user owns a submission, favorite, or comment before changing it.
Testing
- Use fakes of the repository interfaces to unit-test a facade or a service.
- Integration-test repository implementations against MariaDB in Testcontainers, never production.
Gotchas
- No packed implementation exists.
Zymergi.Social.MariaDbis not published. - That project's
AddSocialRepositories()registers scoped repositories that take aDbConnectionfrom DI, which is the pattern theZymergi.DataREADME warns against. UseAddSocialRepositories("app"), which builds them from theIDbConnectionFactory. Its repositories also have(IDbConnectionFactory, string)constructors.
Types
Namespace Zymergi.Social: User, Group, FaveItem, Visibility, UserSubmission, Comment, IUserRepo, IUserSubmissionRepository, ICommentRepository, ISocialFacade, the group and submission profile DTOs, and UpdateFaveItemGroupViewModel. Namespace Zymergi.Social.Data: IFaveItemRepository.
Version notes
11.4.0-alpha: no API change.
11.3.0-alpha: references Zymergi.Data, which now holds the ADO.NET helpers.
| 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
- HtmlAgilityPack (>= 1.13.1)
- Zymergi.Core (>= 11.4.0-alpha)
- Zymergi.Data (>= 11.4.0-alpha)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on Zymergi.Social:
| Package | Downloads |
|---|---|
|
Zymergi.Identity.Auth0
Auth0 identity provider implementation for Zymergi. |
|
|
Zymergi.Social.MariaDb
MariaDB persistence and DI registration for the Zymergi Social domain. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 11.4.0-alpha | 67 | 11/16/2026 |
| 11.3.0-alpha | 71 | 11/12/2026 |
| 11.2.0-alpha | 74 | 11/2/2026 |
| 11.1.1-alpha | 99 | 10/4/2026 |
| 11.1.0-alpha | 116 | 10/1/2026 |
| 11.0.6-alpha | 130 | 7/10/2026 |
| 11.0.5-alpha | 142 | 7/9/2026 |
| 11.0.4-alpha | 98 | 7/6/2026 |
| 11.0.3-alpha | 94 | 7/6/2026 |