Last active
September 29, 2023 12:35
-
-
Save MichalGrzegorzak/5fcbf6cb1086f146baafbf9733bcefa6 to your computer and use it in GitHub Desktop.
Renaming duplicated elements
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var groupedLines = lines.GroupBy(x => new { x.TRACType, x.Description }) | |
.Where(z => z.Count() > 1) | |
.Select(x => x); | |
foreach (var grp in groupedLines) | |
{ | |
int idx = 1; | |
foreach (BudgetLine budgetLine in grp) | |
{ | |
budgetLine.Description = $"{budgetLine.Description} {idx}"; | |
idx++; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment