/// <summary> /// Adds a customer to the database /// </summary> /// <param name="customer">Customer to add to database</param> public void AddCustomer(Customer customer) { var newEntity = Mapper.MapCustomer(customer); // Make sure customer id is set to 0 since this is SUPPOSED TO BE a new customer newEntity.CustomerId = 0; _context.Add(newEntity); _context.SaveChanges(); }
public void AddOrder(Order order) { var entity = Mapper.MapOrder(order); _context.Add(entity); }