private static void SetConnectedRelations(NumberId numberId) { numberId.IsConnected = true; foreach (var rel in numberId.Relations) { if (!rel.IsConnected) { SetConnectedRelations(rel); } } }
private static NumberId CreateNumberId(string name) { var numberId = _numberIds.FirstOrDefault(x => x.Name == name); if (numberId == null) { numberId = new NumberId { Name = name, Relations = new List <NumberId>() }; _numberIds.Add(numberId); } return(numberId); }