コード例 #1
0
 public bool Create(Product product)
 {
     try
     {
         _context.Products.Add(product);
         _context.SaveChanges();
         return(true);
     }
     catch
     {
         return(false);
     }
 }
コード例 #2
0
 public bool Create(Order order)
 {
     _context.Add(order);
     try
     {
         _context.SaveChanges();
         return(true);
     }
     catch
     {
         return(false);
     }
 }
コード例 #3
0
 public bool Create(User user)
 {
     _context.Users.Add(user);
     try
     {
         _context.SaveChanges();
         return(true);
     }
     catch
     {
         return(false);
     }
 }