Exemplo n.º 1
0
 public static JobConfigurationTemplateDto ToDto(this IJobConfiguration configuration, IJobConfigurationMapper mapper)
 {
     return(new JobConfigurationTemplateDto()
     {
         Description = configuration.Description,
         DisplayName = configuration.DisplayName,
         ExampleConfiguration = mapper.Serialize(configuration.CreateExample())
     });
 }
Exemplo n.º 2
0
 public static JobDto ToDto(this Job job, IJobConfigurationMapper mapper)
 {
     if (job == null)
     {
         return(null);
     }
     return(new JobDto()
     {
         Name = job.Name,
         Description = job.Description,
         ConcurrentLimit = job.ConcurrentLimit,
         Enabled = job.Enabled,
         LastUpdated = job.LastUpdated,
         TriggerCronSyntax = job.TriggerCronSyntax,
         Configuration = mapper.Serialize(job.Configuration)
     });
 }
 public static JobModel ToModel(this Job job, IJobConfigurationMapper configMapper)
 {
     if (job == null)
     {
         return(null);
     }
     return(new JobModel
     {
         Name = job.Name,
         Description = job.Description,
         ConcurrentLimit = job.ConcurrentLimit,
         Enabled = job.Enabled,
         JobType = job.Configuration?.TypeName ?? "",
         //JobType = job.JobType,
         TriggerCronSyntax = job.TriggerCronSyntax,
         Configuration = configMapper.Serialize(job.Configuration),
         LastUpdated = job.LastUpdated
     });
 }