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

InvalidOperationException if a context has foreign keys upon multiple columns #25

Open
Pankraty opened this issue Nov 9, 2020 · 1 comment
Assignees

Comments

@Pankraty
Copy link

Pankraty commented Nov 9, 2020

Hi!

I tried to connect this library to the project I work on but found the issue which makes it impossible for us to use it because it throws InvalidOperationException on initialization. The investigation shows that the reason is that some of the foreign keys we have been set upon multiple columns, while LazyEntityGraph expect there is alwas a single one:

IPropertyBase fkPrincipalProp = fkProp.PrincipalKey.Properties.Single();
var foreignKeyPropInfo = fkProp.Properties.Single().PropertyInfo;

Here I came up with the test reproducing the issue and I was hoping I'll be able to fix it myself and submit a pull request but it seems, this can be more tricky that I can handle.

@dbroudy do you maybe have an idea about how this can be fixed?

@dbroudy
Copy link
Owner

dbroudy commented Nov 15, 2020

@Pankraty Thanks for the report and the test case. It requires some changes to the ForeignKeyConstraint too, not just the key selectors, but I think it's not going to be too bad. I have some changes in progress and just have to do some more testing.

@dbroudy dbroudy self-assigned this Nov 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants