Example #1
0
        public async Task <Guid> AddJobAsync(CreateJobAppointmentCommandModel model)
        {
            var jobAppointment = new JobAppointment(
                model.Name,
                model.Description,
                model.ShouldRunAt,
                model.Timezone,
                Enum.Parse <RepeatType>(model.RepeatType),
                model.RepeatInterval,
                model.ExternalUrl);

            await _jobAppointmentsRepository.AddAsync(jobAppointment);

            RegisterJob(jobAppointment);

            StartJob(jobAppointment.Id);

            return(jobAppointment.Id);
        }
Example #2
0
        public async Task <IActionResult> AddJobAppointmentAsync([FromBody] CreateJobAppointmentCommandModel model)
        {
            var jobId = await _jobsManagementService.AddJobAsync(model);

            return(Ok(jobId));
        }