Exemplo n.º 1
0
        public async Task <int> SaveProduct(Product product)
        {
            if (product == null)
            {
                throw new ArgumentNullException($"{nameof(product)} can not be null");
            }

            _productServiceDbContext.Add(product);
            return(await _productServiceDbContext.SaveChangesAsync());
        }
Exemplo n.º 2
0
 public void Add(Product product)
 {
     _context.Add(product);
     _context.SaveChanges();
 }