public void RemoveGate(string id) { Gates?.RemoveAll(_ => _.ID == id); Bridges?.RemoveAll(_ => _.ID == id); }
public void RemoveBridge(string id, string regId) { Bridges?.Where(b => b.ID == id).ToList().ForEach(_ => _.Links?.RemoveAll(r => r == regId)); Bridges?.RemoveAll(_ => _.Links == null || _.Links.Count == 0);//删除空的关联列表 }
public void RemoveRegion(string id) { Regions?.RemoveAll(_ => _.ID == id); Bridges?.ForEach(_ => _.Links?.RemoveAll(r => r == id)); Bridges?.RemoveAll(_ => _.Links == null || _.Links.Count == 0); }