public static void EditEntry(LevelModel model) { using (var ctx = new BotsDbContext()) { ctx.Entry(model).State = EntityState.Modified; ctx.SaveChanges(); } }
public static void DeleteEntry(string name, string guild) { var toDelete = GetUserLevel(name, guild); using (var ctx = new BotsDbContext()) { ctx.Entry(toDelete).State = EntityState.Deleted; ctx.SaveChanges(); } }