Esempio n. 1
0
        public void SaveAccount(Account account)
        {
            AccountDBEntities entities = new AccountDBEntities();

            entities.Accounts.Attach(account);
            entities.Entry(account).State = EntityState.Modified;
            entities.SaveChanges();
        }
Esempio n. 2
0
 public void Add(Account account)
 {
     using (var context = new AccountDBEntities())
     {
         context.Accounts.Add(account);
         context.SaveChanges();
     }
 }