Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.IO;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using AT.Domain.Repositories;
- using Microsoft.Azure.WebJobs;
- namespace AT.WebJobs
- {
- public class Functions
- {
- private readonly ICustomerRepository _customerRepository;
- public Functions(ICustomerRepository customerRepository)
- {
- _customerRepository = customerRepository;
- }
- // This function will get triggered/executed when a new message is written
- // on an Azure Queue called queue.
- public void TimerJob([TimerTrigger("0 * * * * *", RunOnStartup = true)] TimerInfo timerInfo, TextWriter log)
- {
- log.WriteLine("Triggered at " + DateTime.Now);
- var customer = _customerRepository.FindByUser("99d0786a-ece0-4304-b836-9d1c0fd88629");
- log.WriteLine($"Customer {customer.FirstName} {customer.LastName}");
- log.WriteLine("Finished at " + DateTime.Now);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement