Exemple #1
0
        //This method is not used. Instead, adding an Order with the Account property set
        //causes a row to be added to the the Accounts table
        public bool Create(Account account)
        {
            EntityEntry <Account> accountEntry = context.Accounts.Add(account);

            try {
                return(context.SaveChanges() == 1);
            }
            catch (DbUpdateException)
            {
                return(false);
            }
        }
Exemple #2
0
 public bool Create(Product product)
 {
     context.Products.Add(product);
     try
     {
         return(context.SaveChanges() == 1);
     }
     catch (DbUpdateException)
     {
         return(false);
     }
 }