コード例 #1
0
 // 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();
     }
 }
コード例 #2
0
 static private void UpdatePosition(Position pos)
 {
     using (var db = new CouatlContext())
     {
         db.Positions.Attach(pos);
         db.Entry(pos).State = EntityState.Modified;
         db.SaveChanges();
     }
 }
コード例 #3
0
 static public void UpdateAccount(Account acct)
 {
     using (var db = new CouatlContext())
     {
         db.Accounts.Attach(acct);
         db.Entry(acct).State = EntityState.Modified;
         db.SaveChanges();
     }
 }