Recurring jobs with single method having different parameters

I am using Hangfire Recurringjob api to scedule some jobs but I am using same method with different arguements. For ex
for SelectAll(int scenario){};

Here the recurring job is getting overridden instead adding both jobs with different scenario .
Please help me how can it solve my use case.

Hi @sachin_kumar!

When you use this overload of RecurringJob.AddOrUpdate method Hangfire generate recurring job id by type and method name:

public class SomeType 
    public void SelectAll(int i) { ... }


// recurringJobId = "SomeType.SelectAll"

Thus RecurringJob.AddOrUpdate(SelectAll(1)) create new “SomeType.SelectAll” recurring job, but RecurringJob.AddOrUpdate(SelectAll(2)) override it.

You should use another overload of RecurringJob.AddOrUpdate with recurringJobId parameter to create both jobs:

RecurringJob.AddOrUpdate("SelectAll 1", SelectAll(1));
RecurringJob.AddOrUpdate("SelectAll 2", SelectAll(2));

Can we able to run the above jobs every 2 mins by setting Cron expression? mine is similar case. Even, I set the cron to run at every 2 mins, they executed only one time.
For example,
can below jobs run at every 2 mins?

RecurringJob.AddOrUpdate("SelectAll 1", SelectAll(1), "*/2 * * * *")
RecurringJob.AddOrUpdate("SelectAll 2", SelectAll(1), "*/2 * * * *")