-
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
Includes() with string throws not finding navigation path exception when type T is derived #20609
Labels
closed-fixed
The issue has been fixed and is/will be included in the release indicated by the issue milestone.
customer-reported
type-bug
Milestone
Comments
vflame
changed the title
Includes() with string not finding navigation path when type T is derived
Includes() with string throws not finding navigation path exception when type T is derived
Apr 12, 2020
maumar
added a commit
that referenced
this issue
Apr 14, 2020
…path exception when type T is derived Fix is to use logging infrastructure for the "invalid include path" error. Log event is configured to throw by default but can be overriden in the dbcontextoptions. Event id is CoreEventId.InvalidIncludePathError
maumar
added a commit
that referenced
this issue
Apr 14, 2020
…path exception when type T is derived Fix is to use logging infrastructure for the "invalid include path" error. Log event is configured to throw by default but can be overriden in the dbcontextoptions. Event id is CoreEventId.InvalidIncludePathError
maumar
added a commit
that referenced
this issue
Apr 14, 2020
…path exception when type T is derived Fix is to use logging infrastructure for the "invalid include path" error. Log event is configured to throw by default but can be overriden in the dbcontextoptions. Event id is CoreEventId.InvalidIncludePathError
maumar
added a commit
that referenced
this issue
Apr 14, 2020
…path exception when type T is derived Fix is to use logging infrastructure for the "invalid include path" error. Log event is configured to throw by default but can be overriden in the dbcontextoptions. Event id is CoreEventId.InvalidIncludePathError
maumar
added a commit
that referenced
this issue
Apr 17, 2020
…path exception when type T is derived Fix is to use logging infrastructure for the "invalid include path" error. Log event is configured to throw by default but can be overriden in the dbcontextoptions. Event id is CoreEventId.InvalidIncludePathError
maumar
added
the
closed-fixed
The issue has been fixed and is/will be included in the release indicated by the issue milestone.
label
Apr 17, 2020
converted the error to use logging infra instead of just throwing. The behavior can be configured so that the exception is not thrown when the error occurs (although by default it is still thrown). |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
closed-fixed
The issue has been fixed and is/will be included in the release indicated by the issue milestone.
customer-reported
type-bug
Is it possible to have Includes() using strings not throw an exception when a derived type is passed in that doesn't have a specific navigation property? My use case is a generic method that will eager-load all navigation properties for one hierarchy. I'm using OfType() and having to set the DbSet to the base type as a workaround but it seems redundant since DbSet already defines the type and OfType should be unnecessary. Using
Include
with public navigation properties (e.g.,Include(p=> ((ClassA)p).SubA)
) works but these navigations are configured as private fields/private properties. This will likely go away when #2953 is resolved.For example,
Further technical details
EF Core version: 5 preview 3 daily
Database provider: Mssqlocaldb
Target framework: .NET 5
Operating system: Win 10
IDE: Visual Studio 2019 Preview
The text was updated successfully, but these errors were encountered: