public async static void AddNew(CashLog item) { using (var db = new LogDb()) { db.Cash.Add(item); await db.SaveChangesAsync(); } }
public async static void UpdateAsync(CashLog item) { using (var db = new LogDb()) { db.Cash.Attach(item); db.Entry(item).State = System.Data.Entity.EntityState.Modified; await db.SaveChangesAsync(); } }