public void AddProduct(Product product) { try { db.Product.Add(product); } catch (Exception ex) { Console.Write(ex.InnerException); Console.Write(ex.Message); } }
public void Edit_Product(int id, Product editProduct) { Product product = db.Product.FirstOrDefault(s => s.Id == id); product = editProduct; db.SaveChanges(); }