public void CloseSIM(int id) { SIM sim = GetSIM(id); if (sim != null) { sim.Close(); context.SaveChanges(); } }