예제 #1
0
 public static WorkArguments ToWorkArguments(this HfUserJobModel data)
 {
     return(new WorkArguments()
     {
         JobType = data.JobType,
         WorkDataId = data.WorkDataId,
         WorkerClassName = data.WorkerClassName,
         WorkerAssemblyName = data.WorkerAssemblyName,
         Name = data.Name,
         UserJobId = data.Id
     });
 }
예제 #2
0
 public static HfUserJob ToDbModel(this HfUserJobModel model)
 {
     return(new HfUserJob()
     {
         Id = model.Id,
         JobType = model.JobType,
         CreatedOn = model.CreatedOn,
         Name = model.Name,
         Note = model.Note,
         Status = model.Status,
         TimeZoneId = model.TimeZoneId,
         UpdatedOn = model.UpdatedOn,
         UserId = model.UserId,
         WorkDataId = model.WorkDataId,
         WorkerClassName = model.WorkerClassName,
         WorkerAssemblyName = model.WorkerAssemblyName,
         HfJobId = model.HfJobId,
     });
 }
예제 #3
0
 public static bool IsRecurringOrScheduled(this HfUserJobModel record) => IsScheduledJob(record) || IsFireAndForgetJob(record);
예제 #4
0
 public static bool IsFireAndForgetJob(this HfUserJobModel record) => record.JobType == JobType.FireAndForget;
예제 #5
0
 public static bool IsScheduledJob(this HfUserJobModel record) => record.JobType == JobType.Scheduled;
예제 #6
0
 public static bool IsRecurringJob(this HfUserJobModel record) => record.JobType == JobType.Recurring;
예제 #7
0
 public static HfUserRecurringJobModel CastToRecurringJobModel(this HfUserJobModel data) => data as HfUserRecurringJobModel;
예제 #8
0
 public static HfUserScheduledJobModel CastToScheduledJobModel(this HfUserJobModel data) => data as HfUserScheduledJobModel;
예제 #9
0
 public static HfUserFireAndForgetJobModel CastToFireAndForgetJobModel(this HfUserJobModel data) => data as HfUserFireAndForgetJobModel;
예제 #10
0
 public static T CastToJobModel <T>(this HfUserJobModel data) where T : HfUserJobModel
 {
     return(data as T);
 }