public Customer Post(Customer customer) { _context.Customers.Add(customer); _context.SaveChanges(); return(customer); }
public static void Run([TimerTrigger("0 */5 * * * *")] TimerInfo myTimer, ILogger log) { log.LogInformation($"C# Timer trigger function executed at: {DateTime.Now}"); using (var context = new HotelLandonContext()) { var personNameGenerator = new PersonNameGenerator(); context.Customers.Add(new HotelLandon.Models.Customer { FirstName = personNameGenerator.GenerateRandomFirstName(), LastName = personNameGenerator.GenerateRandomLastName(), BirthDate = DateTime.Now }); context.SaveChanges(); } }