Closed audacity76 closed 2 years ago
@audacity76 Is this still happening? Can you provide an example?
Please re-open if needed.
Yeah, I'm getting this one as well. You should be able to recreate it just by having two tables that are in different database schemas reference each other with a foreign key.
Yeah, I poked through the code and found the line where the issue is occurring.
The issue is that GetProperties doesn't return navigation properties (see: GetProperties documentation).
@AceCoderLaura Would you be able to submit a PR with a fix?
@AceCoderLaura Would you be able to submit a PR with a fix?
Yeah, I've got a fix for it, I was going to write some tests too but I haven't gotten around to it yet. I should get to it later today.
Looks like I'd have to turn the tests upside down to modify or add table schemas. I might just submit the fix.
@AceCoderLaura Thank you for your contribution! Sorry it took so long for me to circle back to it.
If schema folders are enabled, the generated
InversePropertyAttribute
of the navigation properties (which use nameof) fail to find entities from different schemas / namespaces. Also, the DbContext namespaces aren't correct. It is missing the base namespace. The generated namespace looks like:using Schema = .Schema;
DbContext and Entities need to declare all referenced schemas like:
using Schema = Base.Namespace.Schema;