EntityFramework-Plus Query Filter - Child/Relational entity not loading


Question

I am using Query Filter By Instance on user-id.

Application's entity structure -> one college has many students.

Applied user-id filter on both college and it's student.

When i access data by two user simultaneously, first user get it's college and all it's student but when request comes from second user only college loading failed two load it's student, both users has it's college and associated child students.

This issue occurs only when i query college by id(this.dbContext.College.FirstOrDefault(e => e.Id == collegeId)) not for get all(this.dbContext.College).

Accepted Answer

Disclaimer: I'm the owner of the project Entity Framework Plus

Filtering using instance context + Lazy Loading is a limitation for this library. There is currently no workaround that I may recommend you.

Disclaimer: I'm the owner of the project EntityFramework.DynamicFilters

This library will work better for your situation and can handle this kind of scenario correctly.





Licensed under: CC-BY-SA
Not affiliated with Stack Overflow
Is this KB legal? Yes, learn why