PgNotifyNet 1.0.1-beta
.NET 6.0
.NET Standard 2.1
This is a prerelease version of PgNotifyNet.
dotnet add package PgNotifyNet --version 1.0.1-beta
NuGet\Install-Package PgNotifyNet -Version 1.0.1-beta
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="PgNotifyNet" Version="1.0.1-beta" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add PgNotifyNet --version 1.0.1-beta
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: PgNotifyNet, 1.0.1-beta"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install PgNotifyNet as a Cake Addin
#addin nuget:?package=PgNotifyNet&version=1.0.1-beta&prerelease
// Install PgNotifyNet as a Cake Tool
#tool nuget:?package=PgNotifyNet&version=1.0.1-beta&prerelease
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
.NET library to easily subscribe and listen PostgreSQL Database real time notifications
Install
PM> Install-Package PgNotifyNet -Version 1.0.0-beta
Example
Blazor SignalR Postgresql PgNotifyNet sample application
Sample Code
Register in container:
ConfigureServices(IServicesCollection servicesCollection)
{
...
services.AddPgNotifyNet(connectionString,
o => o.Trigger (t => t.OnTable<Category>("categories").After(Change.Update, Change.Delete))
.Trigger (t => t.OnTable<User>("users").After(Change.Insert))
...
);
Implement IHandleNotification<T>
and handle notification:
public class FooNotificationHandler : IHandleNotification<Category>
{
public async Task OnDataChanged(Category oldData,Category newData, Change change)
{
//handle data change
}
}
or subscribe to PgNotificationService OnDataChange
event
public FooController(IPgNotificationService notificationService)
{
notificationService.OnDataChange += (object? sender, OnDataChangeEventArgs e) => {
//handle notification
};
}
License
MIT
Product | Versions |
---|---|
.NET | net5.0 net5.0-windows net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows net7.0 net7.0-android net7.0-ios net7.0-maccatalyst net7.0-macos net7.0-tvos net7.0-windows |
.NET Core | netcoreapp3.0 netcoreapp3.1 |
.NET Standard | netstandard2.1 |
MonoAndroid | monoandroid |
MonoMac | monomac |
MonoTouch | monotouch |
Tizen | tizen60 |
Xamarin.iOS | xamarinios |
Xamarin.Mac | xamarinmac |
Xamarin.TVOS | xamarintvos |
Xamarin.WatchOS | xamarinwatchos |
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.
-
.NETStandard 2.1
- Microsoft.Extensions.Hosting (>= 6.0.1)
- Npgsql.ConfigureConnection (>= 0.1.1)
-
net6.0
- Microsoft.Extensions.Hosting (>= 6.0.1)
- Npgsql.ConfigureConnection (>= 0.1.1)
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 |
---|---|---|
1.0.1-beta | 80 | 9/17/2022 |
1.0.0-beta | 75 | 9/17/2022 |