Skip to content
Permalink
Browse files

bugFix: additional check for source properties (#478)

It's necessary to check not just that the PrimaryKeyTable is included in SourceTables but even if the current column is included in the foreign key.
Without this check you ends up having multiple duplicated lines for the same property, if the table have more than one foreign key.
  • Loading branch information...
Krnlsoft authored and jeremeguenther committed Oct 10, 2019
1 parent 8557258 commit ed91b539c1147cbc2da11cb606af86419c815287
Showing with 1 addition and 1 deletion.
  1. +1 −1 Source/Components/ComponentBase.cst
@@ -207,7 +207,7 @@ namespace <%=NameSpace%>
<% if (IncludeGetListByFK && cols[x].IsForeignKeyMember) {
foreach(TableKeySchema tableKey in SourceTable.ForeignKeys)
{
if (!SourceTables.Contains(tableKey.PrimaryKeyTable))
if (!SourceTables.Contains(tableKey.PrimaryKeyTable) || !tableKey.ForeignKeyMemberColumns.Contains(cols[x]))
continue;
%>
<%= GetPropertyName(cols[x])%>Source = null;

0 comments on commit ed91b53

Please sign in to comment.
You can’t perform that action at this time.