Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bugFix: additional check for source properties #478

Merged
merged 1 commit into from Oct 10, 2019

Conversation

@Krnlsoft
Copy link
Contributor

Krnlsoft commented Oct 10, 2019

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.

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.
@jeremeguenther

This comment has been minimized.

Copy link
Collaborator

jeremeguenther commented Oct 10, 2019

I have many tables with more than one foreign key on them, and this change did not alter my generated code. Is there something else that is required to trigger this bug?

@niemyjski

This comment has been minimized.

Copy link
Contributor

niemyjski commented Oct 10, 2019

@Krnlsoft any chance you could provide us with a sql script to recreate this scenario

@Krnlsoft

This comment has been minimized.

Copy link
Contributor Author

Krnlsoft commented Oct 10, 2019

The issue occur if you set the following properties in the csp file:

  • IncludeComponentLayer = DomainModel
  • IncludeGetListByFK = True

If I have time tonight I will scaffold a little project that display the issue.

Thanks for your time
Have a nice day

@Krnlsoft

This comment has been minimized.

Copy link
Contributor Author

Krnlsoft commented Oct 10, 2019

Here attached a test project,
database.sql is the script for creating the database structure.
If you open the file "Test\WebTest.Domain\RecipeDetailBase.generated.cs" line 113, line 136,
you can see the issue.

Thanks for your time

Test.zip

Copy link
Collaborator

jeremeguenther left a comment

@Krnlsoft I was able to re-create your issue using the DomainModel setting. I have always used ServiceLayer myself.

It looks like DomainModel has at least one other bug in it related to foreign key relationships on an object being created even if that object/table has not been selected to have code generated for it.

@jeremeguenther jeremeguenther merged commit ed91b53 into netTiers:master Oct 10, 2019
@Krnlsoft Krnlsoft deleted the Krnlsoft:patch-1 branch Oct 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.