//Удаление батальона и всех записей о нем public void DelBattalion(string textKey) { MillitaryDbContext context = new MillitaryDbContext(); var foundBatt = from bat in context.Battalions where bat.Name == textKey select bat; context.Battalions.Remove(foundBatt.First()); context.SaveChanges(); }
//Удаление техники и всех записей о ней public void DelEquip(string textKey) { MillitaryDbContext context = new MillitaryDbContext(); var foundEq = from eq in context.Equipments where eq.Name == textKey select eq; context.Equipments.Remove(foundEq.First()); context.SaveChanges(); }
//Удаление бригады и всех записей о ней public void DelBrigade(string textKey) { MillitaryDbContext context = new MillitaryDbContext(); var foundBrig = from brig in context.Brigades where brig.Name == textKey select brig; context.Brigades.Remove(foundBrig.First()); context.SaveChanges(); }