public async Task processSignUpToCourse(ISignUpToCourseService _service) { var courses = simulateReadRequestFromFile(); var emails = new List <Email>(); foreach (var course in courses) { try { var result = await _service.Post(course); if (result != null) { emails.Add(new Email() { email = result.StudentEmail, content = "Sua inscricao foi realizado com sucesso" }); } } catch (ArgumentException) { } sendEmail(emails); } }
public SignUpToCoursesController(ISignUpToCourseService service) { _service = service; JobManager.Initialize(); JobManager.AddJob( async() => await new RegistroTarefasAgendadas().processSignUpToCourse(_service), s => s.ToRunEvery(15).Seconds() ); }
public CourseStatisticsService(ICourseStatisticsRepository repository, IMapper mapper, ISignUpToCourseService signUpToCourseService) { _repository = repository; _mapper = mapper; _signUpToCourseService = signUpToCourseService; }