How can I get the CronExpression (string) from a trigger?
I see the expression in the DB but I am not sure how to retrieve it via the provided API.
How can I get the CronExpression (string) from a trigger?
I see the expression in the DB but I am not sure how to retrieve it via the provided API.
You can simply try to cast the ITrigger
instance to an ICronTrigger
and call the CronExpressionString
property.
if(trigger is ICronTrigger cronTrigger)
{
return cronTrigger.CronExpressionString;
}