[CHANGE] Reworked ExtendedBackgroundService.cs with State logic and actions

This commit is contained in:
max
2025-10-08 18:22:16 +02:00
parent b8d2573d78
commit 2f19d60be0
7 changed files with 230 additions and 86 deletions

View File

@@ -0,0 +1,24 @@
using Microsoft.EntityFrameworkCore;
namespace Manager.Data.Contexts;
public sealed class ApplicationContext : DbContext
{
public ApplicationContext(DbContextOptions<ApplicationContext> options) : base(options)
{
ChangeTracker.QueryTrackingBehavior = QueryTrackingBehavior.NoTracking;
ChangeTracker.LazyLoadingEnabled = false;
Database.EnsureCreated();
}
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
optionsBuilder.AddInterceptors(new DateInterceptor());
}
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
base.OnModelCreating(modelBuilder);
}
}