-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Throw for a shadow Many-To-Many navigation #23362
Comments
This happens for SqlServer too Issue is this "Users" navigation does not exist on CLR type. It is shadow state. @AndriySvyryd model
|
We don't support shadow navigations yet. Duplicate of #3864 |
@smitpatel @AndriySvyryd So it looks like this isn't a something we will patch, right? |
@ajcvickers We could patch to throw early in model validation. |
@AndriySvyryd Okay, let's discuss in triage. |
But the official doc says that it is an supported scenario. The API doc of
That's how I came to try the above code. |
@InspiringCode Thanks. We'll fix the docs. |
Please fix the code instead, at least eventually. In most cases where you would use many-to-many, the bidirectional property will probably make no sense at all in the model and just introduce a DB concern into your domain model. |
@InspiringCode Yes, that is tracked by #3864, as Andriy said above. |
What's the workaround to eagerly load many-to-many? Thanks! |
Found it. #3864 (comment)
|
When calling Include() on Polymorphic Many-To-Many collections, an exception is thrown:
The used DbContext is:
The query is:
The model classes are:
EF Core version: 5
Database provider: Microsoft.EntityFrameworkCore.InMemory
Target framework: .NET 5.0
Operating system: Win 10
The text was updated successfully, but these errors were encountered: