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