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
<PackageReference Include="Vorn.EntityManagement.SignalR.Client" Version="4.6.0" />
<PackageVersion Include="Vorn.EntityManagement.SignalR.Client" Version="4.6.0" />
<PackageReference Include="Vorn.EntityManagement.SignalR.Client" />
paket add Vorn.EntityManagement.SignalR.Client --version 4.6.0
#r "nuget: Vorn.EntityManagement.SignalR.Client, 4.6.0"
#:package Vorn.EntityManagement.SignalR.Client@4.6.0
#addin nuget:?package=Vorn.EntityManagement.SignalR.Client&version=4.6.0
#tool nuget:?package=Vorn.EntityManagement.SignalR.Client&version=4.6.0
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 theEntityNotificationReceived
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
orEntityNotification
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 | Versions 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. |
-
net8.0
- Microsoft.AspNetCore.SignalR.Client.Core (>= 8.0.20)
- Vorn.EntityManagement.Common (>= 4.4.0)
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 |