ITask.cs
interface
public interface ITask
{
void Execute();
}
MailSenderTask.cs
class
public class MailSenderTask : ITask
{
public void Execute()
{
//TODO:....
Thread.Sleep(500);
}
}
Task description ScheduleTasks
scop in appsettings.json
{
"Type": "Scheduler.Tasks.Email.MailSenderTask, Scheduler",
"Name": "Mail Sender Task",
"CronExpression": "*/5 * * ? * *",
"Enabled": true
}
- Type : "[class full name], [assembly name]"
- CronExpression : A cron expression is a string consisting of six or seven subexpressions (fields) that describe individual details of the schedule. These fields, separated by white space, can contain any of the allowed values with various combinations of the allowed characters for that field.
_>docker-compose -f docker-compose.yml up --build