Zymergi.Social 11.4.0-alpha

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

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 ISocialFacade or one repository interface, not on an implementation.
  • Data access follows the Zymergi.Data README: a singleton IDbConnectionFactory, a connection per operation, async with the request's CancellationToken, 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 MarkdigRenderer from Zymergi.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.MariaDb is not published.
  • That project's AddSocialRepositories() registers scoped repositories that take a DbConnection from DI, which is the pattern the Zymergi.Data README warns against. Use AddSocialRepositories("app"), which builds them from the IDbConnectionFactory. 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.

Source: bitbucket.org/zymergy/zymergi.saas

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