SeliseBlocks.NotificationDriver 9.0.0-preview.1

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

SeliseBlocks.NotificationDriver

Overview

SeliseBlocks.NotificationDriver is a powerful, socket-compatible notification driver designed to deliver messages to users based on roles, user IDs, or filters. It supports broadcasting, user-specific, and filter-specific notifications with optional payload persistence for offline storage and later retrieval.

Installation

Install the NuGet package via CLI:

dotnet add package SeliseBlocks.NotificationDriver

Usage

Register Dependencies

In your Program.cs:

using Blocks.Extension.DependencyInjection;

builder.Services.RegisterNotificationService();


Features

✅ Notify via Socket or Persisted Channel

To send a notification, construct a NotifyRequest and use the NotifyAsync method:

var notifyRequest = new NotifyRequest
{
    ConnectionId = "connection-123", // Optional socket connection ID
    UserIds = new List<string> { "user1", "user2" },
    Roles = new List<string> { "admin", "moderator" },
    SubscriptionFilters = new List<SubscriptionFilter>
    {
        new SubscriptionFilter { Key = "Department", Value = "HR" }
    },
    DenormalizedPayload = JsonSerializer.Serialize(new { Message = "Welcome to SeliseBlocks!" }),
    SaveDenormalizedPayloadAsAnObject = true,
    ConfiguratoinName = "default",
    ContentAvailable = true,
    ResponseKey = "status",
    ResponseValue = "sent"
};

var response = await notificationDriverService.NotifyAsync(notifyRequest);

NotifyRequest Structure

NotifyRequest inherits from NotifierPayload and contains all required fields to send notifications.

🔹 NotifierPayload Fields

Property Description
ConnectionId Optional; socket connection ID for direct delivery
UserIds List of user IDs for user-specific notifications
Roles Roles for role-based delivery
SubscriptionFilters Filter-based delivery (key-value)
DenormalizedPayload Offline payload as JSON string
SaveDenormalizedPayloadAsAnObject If true, stores JSON as an object in DB

🔹 NotifyRequest Additional Fields

Property Description
ConfiguratoinName The configuration name or channel profile
ContentAvailable Used for push notification availability hints
ResponseKey Custom response key
ResponseValue Custom response value

Example Configuration

Ensure you have the appropriate socket or offline handling logic in place to consume and store messages as needed.


Summary

SeliseBlocks.NotificationDriver provides an elegant and flexible way to send structured notifications across different targeting mechanisms. It is socket-ready and supports role-based, user-based, and filter-based delivery patterns with optional payload persistence.

🚀 Ideal for modern, event-driven applications requiring real-time or offline user notifications.

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  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.
  • net9.0

    • No dependencies.

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
9.0.0-preview.1 352 6/24/2025