예제 #1
0
        public static ScheduledJobDefinition Create <T>(string cron,
                                                        T body = default,
                                                        Dictionary <string, string> attributes = null,
                                                        List <MetadataAttribute> metadata      = null)
        {
            var definition = new ScheduledJobDefinition
            {
                Cron       = cron,
                Name       = typeof(T).FullName,
                Attributes = attributes,
                Metadata   = metadata
            };

            definition.SetBody(body);

            return(definition);
        }
예제 #2
0
 public ScheduledJob(string id, ScheduledJobDefinition definition, DateTimeOffset?nextRun = null)
 {
     Id         = id;
     Definition = definition;
     NextRun    = nextRun;
 }