Exemple #1
0
        /// <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 SaveChanges()
 {
     _context.SaveChanges();
 }
 /// <summary>
 /// Makes the changes to the customer persist
 /// </summary>
 public void SaveCustomer()
 {
     dbcontext.SaveChanges();
 }