Masterly.NightShift.EntityFrameworkCore
1.0.0
dotnet add package Masterly.NightShift.EntityFrameworkCore --version 1.0.0
NuGet\Install-Package Masterly.NightShift.EntityFrameworkCore -Version 1.0.0
<PackageReference Include="Masterly.NightShift.EntityFrameworkCore" Version="1.0.0" />
<PackageVersion Include="Masterly.NightShift.EntityFrameworkCore" Version="1.0.0" />
<PackageReference Include="Masterly.NightShift.EntityFrameworkCore" />
paket add Masterly.NightShift.EntityFrameworkCore --version 1.0.0
#r "nuget: Masterly.NightShift.EntityFrameworkCore, 1.0.0"
#:package Masterly.NightShift.EntityFrameworkCore@1.0.0
#addin nuget:?package=Masterly.NightShift.EntityFrameworkCore&version=1.0.0
#tool nuget:?package=Masterly.NightShift.EntityFrameworkCore&version=1.0.0
Masterly.NightShift.EntityFrameworkCore
Entity Framework Core storage for Masterly.NightShift background jobs: SQL Server, PostgreSQL, SQLite, MySQL and any other relational provider. With your own context, jobs can be staged so they are created only if your SaveChanges commits.
This is a package of Masterly.NightShift, reliable background jobs for .NET.
Install
dotnet add package Masterly.NightShift.EntityFrameworkCore
- Target frameworks:
net8.0,net10.0 - Dependencies:
Masterly.NightShift.Core, Microsoft.EntityFrameworkCore.Relational (8.x onnet8.0, 10.x onnet10.0), plus the provider you choose
Example
using Masterly.NightShift;
// Your context includes the storage's tables, so your migrations create them
public class ShopContext(DbContextOptions<ShopContext> options) : DbContext(options)
{
public DbSet<Order> Orders => Set<Order>();
protected override void OnModelCreating(ModelBuilder modelBuilder) => modelBuilder.ApplyNightShiftModel();
}
builder.Services.AddDbContextFactory<ShopContext>(o => o.UseNpgsql(connectionString));
builder.Services.AddNightShift((provider, config) => config.UseEntityFrameworkCoreStorage(
() => provider.GetRequiredService<IDbContextFactory<ShopContext>>().CreateDbContext()));
builder.Services.AddNightShiftServer();
// The order and its confirmation email, or neither
db.Orders.Add(order);
db.NightShift().Enqueue<IEmailSender>(x => x.SendConfirmation(order.Id));
await db.SaveChangesAsync();
Without a context of your own, UseEntityFrameworkCoreStorage(o => o.UseSqlServer(connectionString)) gives the storage one, and it creates its tables in the nightshift schema when they are missing.
Documentation
Options, how the storage works and what to know before running it in production: https://a7mdfre7at.github.io/Masterly.NightShift/docs/storage/entity-framework-core
License
MIT: this package holds only code written for Masterly.NightShift. It depends on Masterly.NightShift.Core, which is MIT AND LGPL-3.0-or-later because part of its code is derived from Hangfire.
| 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 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. |
-
net10.0
- Masterly.NightShift.Core (>= 1.0.0)
- Microsoft.EntityFrameworkCore.Relational (>= 10.0.15)
-
net8.0
- Masterly.NightShift.Core (>= 1.0.0)
- Microsoft.EntityFrameworkCore.Relational (>= 8.0.34)
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.0 | 0 | 11/16/2026 |
Release notes for version 1.0.0: https://github.com/a7mdfre7at/Masterly.NightShift/blob/master/CHANGELOG.md