Ejemplo n.º 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();
        }
Ejemplo n.º 2
0
        public void AddOrder(Order order)
        {
            var entity = Mapper.MapOrder(order);

            _context.Add(entity);
        }