Closed amselem closed 8 years ago
I see that mainly the bug is that the list is not sorted. But I don't understand the need of a GroupBy
?
Also the OrderBy
could it be just OrderBy(p => p.Address)
?
The original bug created programs with duplicated Ids, so I ended with a program list with Ids: 1000, 1000,1000,1001..... I first implemented the sorting fix, but the loop assumed each Id is unique so it stopped at 2n element because the candidate Id (1001) != Program.Id (1000). So it returned 1001 as the new id wich is incorrect because it existed in the Program list. I guess you can remove the groupby and it will work for new or non corrupted installs but for me was necesary
ok I will then add the OrderBy to the old code.
…ated pids.
remove unused imports.