mirror of
https://github.com/C9Glax/tranga.git
synced 2025-07-04 09:54:16 +02:00
Add Migrations
Add RemoveOldNotificationsWorker.cs
This commit is contained in:
@ -6,7 +6,13 @@ namespace API.Workers;
|
||||
public abstract class BaseWorkerWithContext<T>(IEnumerable<BaseWorker>? dependsOn = null) : BaseWorker(dependsOn) where T : DbContext
|
||||
{
|
||||
protected T DbContext = null!;
|
||||
public void SetScope(IServiceScope scope) => DbContext = scope.ServiceProvider.GetRequiredService<T>();
|
||||
private IServiceScope? _scope;
|
||||
|
||||
public void SetScope(IServiceScope scope)
|
||||
{
|
||||
this._scope = scope;
|
||||
this.DbContext = scope.ServiceProvider.GetRequiredService<T>();
|
||||
}
|
||||
|
||||
/// <exception cref="ConfigurationErrorsException">Scope has not been set. <see cref="SetScope"/></exception>
|
||||
public new Task<BaseWorker[]> DoWork()
|
||||
|
Reference in New Issue
Block a user