예제 #1
0
        public async Task <IActionResult> Index()
        {
            // backgroundJob.Enqueue(() => Debug.WriteLine("Background Job completed successfully!"));

            await messagesService.AddAsync(new Message { Content = "Hey" });

            backgroundJob.Enqueue(() => LongProcess());

            backgroundJob.Enqueue <ISendRequest>(x => x.SendSmsAsync("Hello HangFire Async!"));

            RecurringJob.AddOrUpdate(() => Console.WriteLine("Daily Job"), Cron.Daily(23, 12));

            return(View());
        }
예제 #2
0
 public async Task <bool> PostAsync([FromBody] Messages message)
 {
     return(await _messagesService.AddAsync(message));
 }