//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); } }
public bool Create(Product product) { context.Products.Add(product); try { return(context.SaveChanges() == 1); } catch (DbUpdateException) { return(false); } }