Пример #1
0
 public static void EditEntry(LevelModel model)
 {
     using (var ctx = new BotsDbContext())
     {
         ctx.Entry(model).State = EntityState.Modified;
         ctx.SaveChanges();
     }
 }
Пример #2
0
        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();
            }
        }