Vorn.EntityManagement.SignalR.Client 4.6.0

dotnet add package Vorn.EntityManagement.SignalR.Client --version 4.6.0
                    
NuGet\Install-Package Vorn.EntityManagement.SignalR.Client -Version 4.6.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="Vorn.EntityManagement.SignalR.Client" Version="4.6.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Vorn.EntityManagement.SignalR.Client" Version="4.6.0" />
                    
Directory.Packages.props
<PackageReference Include="Vorn.EntityManagement.SignalR.Client" />
                    
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 Vorn.EntityManagement.SignalR.Client --version 4.6.0
                    
#r "nuget: Vorn.EntityManagement.SignalR.Client, 4.6.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 Vorn.EntityManagement.SignalR.Client@4.6.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=Vorn.EntityManagement.SignalR.Client&version=4.6.0
                    
Install as a Cake Addin
#tool nuget:?package=Vorn.EntityManagement.SignalR.Client&version=4.6.0
                    
Install as a Cake Tool

Vorn.EntityManagement.SignalR.Client

Philosophy

The client package complements the SignalR server hub and provides a strongly typed abstraction over SignalR connections. Instead of sprinkling HubConnection calls across your UI, you inherit from EntityClient<TDto, TDescriptorDto> to get a resilient proxy that mirrors the CRUD surface of the server. The design promotes:

  • Connection orchestration – The base class lazily creates and starts a SignalR connection via an IEntityConnectionFactory, only when first needed.
  • Command parity – Each CRUD/query call on the client invokes the matching hub method, guaranteeing that client and server contracts evolve together.
  • Notification awareness – Built-in subscription support surfaces EntityNotificationDto events through the EntityNotificationReceived delegate for real-time UI updates.

Getting started

1. Install the package

Install-Package Vorn.EntityManagement.SignalR.Client

2. Implement a connection factory

public sealed class DocumentConnectionFactory : IEntityConnectionFactory
{
    public async Task<HubConnection> CreateConnection<TDto>()
    {
        var connection = new HubConnectionBuilder()
            .WithUrl("https://api.contoso.com/hubs/documents")
            .WithAutomaticReconnect()
            .Build();

        await connection.StartAsync();
        return connection;
    }
}

Register the factory with your dependency injection container so the client can obtain a configured HubConnection.

3. Derive a typed client

public sealed class DocumentClient(IEntityConnectionFactory factory)
    : EntityClient<DocumentDto, DocumentDescriptorDto>(factory)
{ }

The base class guarantees connection startup and event wiring through EnsureConnectionAsync, StartAsync, and RegisterEvents.

4. Consume the client

await using var client = serviceProvider.GetRequiredService<DocumentClient>();
await client.SetInterceptionConfig(userId: "42", time: DateTimeOffset.UtcNow);

var created = await client.AddAsync(new DocumentDto { Title = "Roadmap" });
var paged = await client.GetPagedAsDtoAsync(new DocumentDescriptorDto { TenantId = "tenant-a" });

If the server emits notifications, subscribe to the EntityNotificationReceived event to update your UI.

client.EntityNotificationReceived += (_, notification) =>
{
    // Refresh the relevant view
};

5. Dispose gracefully

EntityClient implements IAsyncDisposable to stop and dispose of the underlying connection when you're done, even if disposal happens during shutdown.

Usage tips

  • Call SetInterceptionConfig to forward user/time metadata to the server so audit context is maintained for each invocation.
  • Override RegisterEvents or EntityNotification in a derived class if you need custom notification handling (e.g., mapping to view models) before raising the event.
  • Combine the client with typed DTOs produced by Vorn.EntityManagement.Generators for a zero-boilerplate experience across REST and SignalR transports.

Release artifacts

The README is packaged with the NuGet distribution, making the setup guidance available inside Visual Studio, NuGet.org, and dotnet package tooling.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  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
4.6.0 147 10/5/2025
4.5.0 198 9/26/2025
4.4.4 160 9/25/2025
4.4.3 160 9/25/2025
4.4.2 162 9/25/2025
4.4.1 158 9/24/2025
4.4.0 163 9/24/2025
4.3.0 166 9/23/2025
4.2.0 158 9/23/2025
4.1.0 163 9/23/2025
4.0.0 189 9/22/2025
4.0.0-rc1 147 9/21/2025
4.0.0-alpha 165 9/20/2025
3.6.0 289 9/17/2025
3.4.0 280 9/17/2025
3.3.1 296 9/17/2025
3.3.0 289 9/17/2025
3.2.0 293 9/17/2025
3.1.1 295 9/17/2025
3.1.0 291 9/17/2025
3.0.0 303 9/16/2025