Exemple #1
0
        public void Delete(Product obj)
        {
            var productToDelete = new ProductTable();

            _mapper.Map(obj, productToDelete);

            _context.Products.Remove(productToDelete);

            _context.SaveChanges();
        }
Exemple #2
0
        public void Add(Product obj)
        {
            var productToSave = new ProductTable();

            _mapper.Map(obj, productToSave);

            _context.Products.Add(productToSave);

            _context.SaveChanges();
        }