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()); }
public void Add(Product product) { _context.Add(product); _context.SaveChanges(); }