public async Task <ActionResult <BookingCustomer> > PostBookingCustomer(BookingCustomer bookingCustomer) { _context.BookingCustomers.Add(bookingCustomer); await _context.SaveChangesAsync(); return(CreatedAtAction("GetBookingCustomer", new { id = bookingCustomer.BookingCustomerId }, bookingCustomer)); }
public async Task <IActionResult> PutBookingCustomer(int id, BookingCustomer bookingCustomer) { if (id != bookingCustomer.BookingCustomerId) { return(BadRequest()); } _context.Entry(bookingCustomer).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!BookingCustomerExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
static void createCustomers(GraphService graphService, BookingBusinessSingle business) { BookingCustomer customer = business.Customers.NewEntityWithChangeTracking(); customer.DisplayName = "customer6"; customer.EmailAddress = "*****@*****.**"; graphService.SaveChanges(SaveChangesOptions.PostOnlySetProperties); Console.WriteLine("done"); }