-
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
Remove anonymous type info from Include exception message #4058
Comments
Looks like we are re-using a string when throwing from Include that does not make sense. Include does not support anonymous types like that. Here is the correct syntax. List<Blog> blogs = db.Blogs
.Include(b => b.Posts).ThenInclude(p => p.Comments)
.Include(b => b.Posts).ThenInclude(p => p.Images)
.ToList(); Leaving this issue open to address the issue with the exception message |
@rowanmiller - What should be the exception message here? |
We just need to remove the last part about using an anonymous type. Here is what it should be.
BTW, no need to over-engineer this one - you can just copy/paste into a new resource. Trying to concatenate resources might sound like it saves duplicating work... but it turns out to be counter productive when it comes time to review/localize/etc. |
@rowanmiller - It turns out that we used wrong exception message. We do have another exception message which is same as you suggested. Though |
I probably wouldn't, it's kind of hard to cover all that in a single message. |
After discussion, we decided to use a FWLink to point to the docs for Include (not yet written)
|
I have the following model:
When I call:
I get the following exception:
The exception itself suggests to use syntax like
t => new { t.MyProperty1, t.MyProperty2 }
which I am currently using.I am using 7.0.0-rc1-final, .Net Framework 4.5.2 and Visual Studio 2015.
The text was updated successfully, but these errors were encountered: