Пример #1
0
 public void DeleteAccount(long id)
 {
     using (Ms2DbContext Context = new Ms2DbContext())
     {
         Account Account = Context.Accounts.Find(id);
         Context.Remove(Account);
         Context.SaveChanges();
     }
 }
Пример #2
0
 public void DeleteCharacter(long characterId)
 {
     using (Ms2DbContext context = new Ms2DbContext())
     {
         Character character = context.Characters.FirstOrDefault(column => column.CharacterId == characterId);
         context.Remove(character);
         context.SaveChanges();
     }
 }
Пример #3
0
 public static void DeleteAccount(long id)
 {
     using (Ms2DbContext context = new Ms2DbContext())
     {
         Account account = context.Accounts.Find(id);
         context.Remove(account);
         context.SaveChanges();
     }
 }
 public static void DeleteCharacter(long characterId, string characterName = "")
 {
     using (Ms2DbContext context = new Ms2DbContext())
     {
         Character character = context.Characters.FirstOrDefault(a => (a.CharacterId == characterId) || (a.Name.ToLower() == characterName.ToLower()));
         context.Remove(character);
         context.SaveChanges();
     }
 }
Пример #5
0
 public static void DeleteSkill(long characterId, long skillId)
 {
     using (Ms2DbContext context = new Ms2DbContext())
     {
         SkillTree skill = context.SkillTrees.Where(column => column.CharacterId == characterId)
                           .FirstOrDefault(column => column.SkillId == skillId);
         context.Remove(skill);
         context.SaveChanges();
     }
 }
Пример #6
0
        public static void DeleteItem(long uid)
        {
            using (Ms2DbContext context = new Ms2DbContext())
            {
                Item item = context.Items.Find(uid);

                context.Remove(item);
                context.SaveChanges();
            }
        }
Пример #7
0
        public void DeleteItem(long uid)
        {
            using (Ms2DbContext Context = new Ms2DbContext())
            {
                Item Item = Context.Items.Find(uid);

                Context.Remove(Item);
                Context.SaveChanges();
            }
        }
Пример #8
0
        public void DeleteSkill(long characterId, long skillId)
        {
            using (Ms2DbContext Context = new Ms2DbContext())
            {
                SkillTree Skill = Context.SkillTrees.Where(c => c.CharacterId == characterId)
                                  .FirstOrDefault(s => s.SkillId == skillId);

                Context.Remove(Skill);
                Context.SaveChanges();
            }
        }