示例#1
0
 public int CreateProduct(Domain.BE.Product product)
 {
     try
     {
         ProductRepository repo = new ProductRepository(context);
         repo.Add(product);
         return(product.Id);
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
示例#2
0
 public bool UpdateProduct(Domain.BE.Product product)
 {
     try
     {
         ProductRepository repo = new ProductRepository(context);
         repo.Update(product);
         return(true);
     }
     catch (Exception)
     {
         return(false);
     }
 }