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