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 }); }
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, }); }
public static bool IsRecurringOrScheduled(this HfUserJobModel record) => IsScheduledJob(record) || IsFireAndForgetJob(record);
public static bool IsFireAndForgetJob(this HfUserJobModel record) => record.JobType == JobType.FireAndForget;
public static bool IsScheduledJob(this HfUserJobModel record) => record.JobType == JobType.Scheduled;
public static bool IsRecurringJob(this HfUserJobModel record) => record.JobType == JobType.Recurring;
public static HfUserRecurringJobModel CastToRecurringJobModel(this HfUserJobModel data) => data as HfUserRecurringJobModel;
public static HfUserScheduledJobModel CastToScheduledJobModel(this HfUserJobModel data) => data as HfUserScheduledJobModel;
public static HfUserFireAndForgetJobModel CastToFireAndForgetJobModel(this HfUserJobModel data) => data as HfUserFireAndForgetJobModel;
public static T CastToJobModel <T>(this HfUserJobModel data) where T : HfUserJobModel { return(data as T); }