Handle same element occurring twice in a node, add warning

This commit is contained in:
Jonathan Jenne 2023-03-27 10:45:07 +02:00
parent 0eb8eaad2d
commit 90029ab0f2

View File

@ -226,9 +226,13 @@ Namespace Documents
Logger.Debug("Creating fields from [{0}] columns for Table [{1}]", oTable.Columns.Count, oTable.Name)
For Each oColumn In oTable.Columns
Dim oSubElement = oSubElements.
Where(Function(e) e.Name = oColumn.Name).
SingleOrDefault()
Dim oQuery = oSubElements.Where(Function(e) e.Name = oColumn.Name)
Dim oElementCount = oQuery.Count()
Dim oSubElement = oQuery.FirstOrDefault()
If oElementCount > 1 Then
Logger.Warn("Found [{0}] elements for column [{1}]. Using first occurrence.")
End If
If oSubElement IsNot Nothing Then
Dim oRequired = oColumn.IsRequired