You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
abp/framework/test/Volo.Abp.BackgroundJobs.Tests/Volo/Abp/BackgroundJobs/MyJob.cs

27 lines
637 B

using System;
using System.Collections.Generic;
using Volo.Abp.DependencyInjection;
using Volo.Abp.MultiTenancy;
namespace Volo.Abp.BackgroundJobs;
public class MyJob : BackgroundJob<MyJobArgs>, ISingletonDependency
{
public List<string> ExecutedValues { get; } = new List<string>();
public Guid? TenantId { get; set; }
private readonly ICurrentTenant _currentTenant;
public MyJob(ICurrentTenant currentTenant)
{
_currentTenant = currentTenant;
}
public override void Execute(MyJobArgs args)
{
ExecutedValues.Add(args.Value);
TenantId = _currentTenant.Id;
}
}