HangfireIO / HangfireIO/Hangfire

passing injected parameter

Open
#693 3 comments 0 reactions 0 assignees View on GitHub
a: core t: enhancement
Dominant language
C#
Stars
10.1k
Forks
1.8k
Avg merge
1h 19m
Merged PRs (30d)
1

Description

How can I inject instances in the method similar to CancellationToken ??

```
public class CustomService : ICustomService
{
public static ICustomService Null => null;
}
public interface ICustomService
{

}
public interface ICustomJob
{
void Execute(ICustomJob customToken);
}
public class CustomJob: ICustomJob
{
public void Execute(ICustomService customService)
{
Thread.Sleep(30000);
}
}

RecurringJob.AddOrUpdate(a => a.Execute(CustomService.Null), Cron.Minutely());

```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.