-
-
Notifications
You must be signed in to change notification settings - Fork 314
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
Query IncludeFilter with AsNoTracking #79
Comments
Unfortunately, our library transforms the query to an anonymous type From ctx.Association_OneToMany_Lefts
.IncludeFilter(x => x.Rights.OrderByDescending(y => y.ID))
.AsNoTracking().ToList(); To ctx.Association_OneToMany_Lefts
.Select(x => new {x, x.Rights})
.AsNoTracking().ToList(); To add relation included (in both example) automatically, the ChangeTracking must be enabled. We will check this weekend if we can find a workaround. I believe the only possible solution will be to create a new context and use the change tracker within it when we found the "AsNoTracking" method is used. So the passed context will not be impacted by the performance and will not track entities returned either. |
I suggest to make a warning on IncludeFilter wiki page, that it doesn't work currently with AsNoTracking. I've spent 1 hour fighting with this... |
Hello @andrew-lis , Yes, you are right. Sorry for the time you lost ;( The Best Regards, Jonathan |
Hi all,
we are trying to use the Query IncludeFilter feature on a query with the AsNoTracking attribute. We noticed that all of the navigation properties, which are supposed to be included, are null.
Is this a known issue, and is there any workaround we can use?
Regards,
Tom
The text was updated successfully, but these errors were encountered: