End Recurring Job after 'n' times execute

Hi all,

i’m using Hangfire version “1.6.8”.
My Code

var datetime = DateTime.Now;
var cron = Cron.Monthly(datetime.Day, datetime.Hour);
RecurringJob.AddOrUpdate<<>IService>( recurringId, x => x.CreateRecurring(id), cron);

my question is this end this Recurring Job after ‘n’ times execute

Thanks in advance

You can keep track of the execution count from within the job, and when a certain threshold has been met, you can either just return right away inside your recurring job without executing any logic, or delete the job from within itself.