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