GenealogicalDataCommunication

This commit is contained in:
2023-04-02 23:19:15 -07:00
parent 5c3a151cd3
commit f69c100669
21 changed files with 677 additions and 376 deletions

View File

@ -331,6 +331,7 @@ internal abstract class MapLogic
{
(long, PersonContainer)[] results;
const int zero = 0;
List<string> errors = new();
string newestPersonKeyFormatted;
List<(long PersonKey, PersonContainer PersonContainer)> collection = new();
foreach (PersonContainer personContainer in personContainers)
@ -347,9 +348,11 @@ internal abstract class MapLogic
foreach (KeyValuePair<long, List<PersonContainer>> keyValuePair in personKeyToPersonContainerCollection)
{
if (keyValuePair.Value.Count != 1 && (from l in keyValuePair.Value select l.DisplayDirectoryName).Distinct().Count() != 1)
throw new NotSupportedException(keyValuePair.Value[zero].DisplayDirectoryName);
errors.Add(keyValuePair.Value[zero].DisplayDirectoryName);
collection.Add(new(keyValuePair.Key, keyValuePair.Value[zero]));
}
if (errors.Any())
throw new Exception(string.Join(Environment.NewLine, errors));
results = (from l in collection orderby l.PersonKey descending select (l.PersonKey, l.PersonContainer)).ToArray();
return results;
}