VS fails to show proper intellisense when using multiple ThenIncludes
See original GitHub issueSee this SO post.
I was trying another .Include(blah).ThenInclude(blah), and while intellisense worked for the first, the second only showed IEnumberable functions/methods which lead me to believe I had mistyped something or it wasn’t supported somehow.
For example…
var reg = _context.Registrations
.Where(r => r.User.UserName == userName)
.Include(r => r.Activities).ThenInclude(a => a.Task)
.Include(r => r.Activities).ThenInclude(a => a.Responses)
.FirstOrDefault();
The second a
in the second ThenInclude
did not show this as being a valid property. Thanks to the contributor to my SO post I tried building and running it anyways and it worked fine. VS lead me astray! 😉 Is this the proper place to report this?
VS Info…
Microsoft Visual Studio Professional 2015 Version 14.0.24720.00 Update 1 Microsoft .NET Framework Version 4.6.01055 Installed Version: Professional
EF info (as per project.json & “References” tree control in VS)…
EntityFramework.Core (7.0.0-rc1-final)
Issue Analytics
- State:
- Created 8 years ago
- Reactions:2
- Comments:14 (10 by maintainers)
Top GitHub Comments
@powermetal63 - Please file an issue on roslyn repo.
I’m with VS 16.3.9 and still see it.
The difference with the example from Roslyn issue is that there the collection overload is defined as
while in EF Core it is
So when the navigation property type is
ICollection<T>
(or some other enumerable derived interface), the Intellisense does not offerT
members initially. If the navigation property type isIEnumerable<T>
, it works.