public bool RemoveEntity(ManagedEntity entity) { if (!Entities.Remove(entity)) { return(false); } entity.DeauthorizeAll(); return(true); }
public bool AddEntity(ManagedEntity entity) { if (Entities.Any(e => e.Id == entity.Id)) { return(false); } Entities.Add(entity); entity.DeauthorizeAll(); entity.Authorize(GetActiveAndSleepingMembers()); return(true); }