// TODO: Make this private because the user should be doing delete/add; it is too difficult to change Type. static private void UpdateTransaction(Transaction xact) { using (var db = new CouatlContext()) { db.Transactions.Attach(xact); db.Entry(xact).State = EntityState.Modified; db.SaveChanges(); } }
static private void UpdatePosition(Position pos) { using (var db = new CouatlContext()) { db.Positions.Attach(pos); db.Entry(pos).State = EntityState.Modified; db.SaveChanges(); } }
static public void UpdateAccount(Account acct) { using (var db = new CouatlContext()) { db.Accounts.Attach(acct); db.Entry(acct).State = EntityState.Modified; db.SaveChanges(); } }