Cannot load Claims of all Users with lazy loading disabled


In my application there is a line that gets all users
 var claims = userManager.Users.ToList()
And then attempts to aggregate all claims. This seems to break as no claims are loaded at all with LazyLoadingEnabled = false.

I understand the issue, but there seems to be no way to fix it as there is no Include() method on IQueryable and EF (insanely) doesn't support eager collection loading.

What the heck? What's the solution here? Is this a bug that's known? One that's going to get fixed?
Closed Oct 5, 2015 at 10:15 PM by raspranav


raspranav wrote Oct 5, 2015 at 10:15 PM

You need to include the System.Data.Entity namespace which has the Include() extension method.