Skip to content

Commit

Permalink
Algorithm fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
AnteVuletic committed Jun 5, 2019
1 parent 96d8a0e commit 21ecd42
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Backend/Normalization.Maps/Algorithm/Algorithm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,15 @@ public static NormalizedViewModel NormalizeTable(TableViewModel table)
var decompositionElement = new List<string>();
decompositionElement.AddRange(dependencyViewModel.From);
decompositionElement.Add(dependencyViewModel.To);
normalizedTable.TableAttributes.Add(decompositionElement);
if (normalizedTable.TableAttributes.All(tableAttribute =>
decompositionElement.All(element => !tableAttribute.Any(ta => ta.Contains(element)))))
normalizedTable.TableAttributes.Add(decompositionElement);
}
normalizedTable.TableAttributes.Add(table.Keys.First());
if(normalizedTable.TableAttributes.All(tableAttribute => !tableAttribute.Any(ta => table.Keys.First().All(ta.Contains))))
normalizedTable.TableAttributes.Add(table.Keys.First());

normalizedTable.TableAttributes = normalizedTable.TableAttributes.Distinct().ToList();



return normalizedTable;
Expand Down

0 comments on commit 21ecd42

Please sign in to comment.