Easy.Notifications.Persistence.EntityFramework
1.0.1
dotnet add package Easy.Notifications.Persistence.EntityFramework --version 1.0.1
NuGet\Install-Package Easy.Notifications.Persistence.EntityFramework -Version 1.0.1
<PackageReference Include="Easy.Notifications.Persistence.EntityFramework" Version="1.0.1" />
<PackageVersion Include="Easy.Notifications.Persistence.EntityFramework" Version="1.0.1" />
<PackageReference Include="Easy.Notifications.Persistence.EntityFramework" />
paket add Easy.Notifications.Persistence.EntityFramework --version 1.0.1
#r "nuget: Easy.Notifications.Persistence.EntityFramework, 1.0.1"
#:package Easy.Notifications.Persistence.EntityFramework@1.0.1
#addin nuget:?package=Easy.Notifications.Persistence.EntityFramework&version=1.0.1
#tool nuget:?package=Easy.Notifications.Persistence.EntityFramework&version=1.0.1
Easy.Notifications.Persistence.EntityFramework
The universal persistence layer for the Easy Notification System.
This package implements the storage logic for Easy.Notifications. It is designed with Multi-Targeting support, making it capable of running on both modern .NET 8 applications (using EF Core) and legacy .NET Framework projects (using EF 6).
By installing this package, you enable audit logging, status tracking, and retry mechanisms for your notifications.
Installation
Install-Package Easy.Notifications.Persistence.EntityFramework
Or via .NET CLI:
dotnet add package Easy.Notifications.Persistence.EntityFramework
Compatibility Matrix
This package automatically adapts its internal implementation based on your project's target framework:
| Your Project Target | Uses Internally | Dependency |
|---|---|---|
| .NET 6.0+ (Core) | Entity Framework Core | Microsoft.EntityFrameworkCore.SqlServer |
| .NET Framework 4.7+ | Entity Framework 6 | EntityFramework (Classic) |
Configuration
1. For .NET 6+ / .NET Core (EF Core)
In your Program.cs, use the extension method to register the storage.
using Microsoft.EntityFrameworkCore;
var builder = WebApplication.CreateBuilder(args);
// 1. Add the Main Engine
builder.Services.AddEasyNotifications();
// 2. Add Persistence (EF Core)
var connectionString = builder.Configuration.GetConnectionString("NotificationDb");
builder.Services.AddNotificationPersistence(options =>
{
// Use SQL Server (or any other EF Core provider)
options.UseSqlServer(connectionString);
});
2. For .NET Framework 4.7+ (EF 6)
In legacy applications (e.g., ASP.NET MVC 5), you typically register dependencies using a container like Unity, Autofac, or Ninject.
// Example using a generic DI container
var connectionString = ConfigurationManager.ConnectionStrings["NotificationDb"].ConnectionString;
// Register the Store Implementation
container.RegisterType<INotificationStore, EfNotificationStore>(
new ConstructorArgument("connectionString", connectionString)
);
Database Setup
The package contains the NotificationLogs entity. You need to create this table in your database.
Option A: Auto-Generate (Development)
For .NET Core apps, you can ensure the database is created at startup:
using (var scope = app.Services.CreateScope())
{
var context = scope.ServiceProvider.GetRequiredService<NotificationDbContext>();
context.Database.EnsureCreated();
}
Option B: Migrations (Production)
Since the DbContext is embedded within this library, you can generate migrations from your host application:
dotnet ef migrations add InitialCreate --context NotificationDbContext
dotnet ef database update --context NotificationDbContext
(For EF6 .NET Framework projects, use the standard Enable-Migrations and Update-Database commands in Package Manager Console).
Features
Unified History: Logs every email, SMS, and chat message sent via the system.
Retry Support: Allows the background worker to fetch failed messages from the database and retry them.
Group Cancellation: Persists cancellation requests to ensure stopped campaigns remain stopped even after a server restart.
Dashboard Ready: Provides the data source for the
Easy.Notificationsdashboard analytics.
The Ecosystem
| Package | Description |
|---|---|
Easy.Notifications.Core |
Abstractions, Interfaces, and Models. |
Easy.Notifications |
The main engine (Worker, Dispatcher, Providers). |
Easy.Notifications.Persistence.EntityFramework |
(You are here) Storage implementation for EF Core & EF 6. |
Contributing
Contributions and suggestions are welcome. Please open an issue or submit a pull request.
Contact
For questions, contact us via elmin.alirzayev@gmail.com or GitHub.
License
This project is licensed under the MIT License.
© 2025 Elmin Alirzayev / Easy Code Tools
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. 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 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 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. |
| .NET Core | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.1 is compatible. |
| .NET Framework | net47 is compatible. net471 was computed. net472 was computed. net48 is compatible. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETFramework 4.7
- Easy.Notifications.Core (>= 1.0.0)
- EntityFramework (>= 6.5.1)
- Microsoft.Extensions.DependencyInjection (>= 10.0.2)
- System.Text.Json (>= 10.0.2)
-
.NETFramework 4.8
- Easy.Notifications.Core (>= 1.0.0)
- EntityFramework (>= 6.5.1)
- Microsoft.Extensions.DependencyInjection (>= 10.0.2)
- System.Text.Json (>= 10.0.2)
-
.NETStandard 2.1
- Easy.Notifications.Core (>= 1.0.0)
- Microsoft.EntityFrameworkCore (>= 3.1.32)
- Microsoft.EntityFrameworkCore.Relational (>= 3.1.32)
- Microsoft.Extensions.DependencyInjection (>= 10.0.2)
- System.Text.Json (>= 10.0.2)
-
net10.0
- Easy.Notifications.Core (>= 1.0.0)
- Microsoft.EntityFrameworkCore (>= 10.0.2)
- Microsoft.EntityFrameworkCore.Relational (>= 10.0.2)
- Microsoft.Extensions.DependencyInjection (>= 10.0.2)
-
net6.0
- Easy.Notifications.Core (>= 1.0.0)
- Microsoft.EntityFrameworkCore (>= 7.0.8)
- Microsoft.EntityFrameworkCore.Relational (>= 7.0.8)
- Microsoft.Extensions.DependencyInjection (>= 7.0.0)
-
net7.0
- Easy.Notifications.Core (>= 1.0.0)
- Microsoft.EntityFrameworkCore (>= 7.0.8)
- Microsoft.EntityFrameworkCore.Relational (>= 7.0.8)
- Microsoft.Extensions.DependencyInjection (>= 7.0.0)
-
net8.0
- Easy.Notifications.Core (>= 1.0.0)
- Microsoft.EntityFrameworkCore (>= 9.0.8)
- Microsoft.EntityFrameworkCore.Relational (>= 9.0.8)
- Microsoft.Extensions.DependencyInjection (>= 9.0.8)
-
net9.0
- Easy.Notifications.Core (>= 1.0.0)
- Microsoft.EntityFrameworkCore (>= 9.0.8)
- Microsoft.EntityFrameworkCore.Relational (>= 9.0.8)
- Microsoft.Extensions.DependencyInjection (>= 9.0.8)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
-