Skip to content
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

Lazy loading of AuditLogDetails #138

Open
ChewieWookie opened this issue Jan 23, 2017 · 0 comments
Open

Lazy loading of AuditLogDetails #138

ChewieWookie opened this issue Jan 23, 2017 · 0 comments

Comments

@ChewieWookie
Copy link

ChewieWookie commented Jan 23, 2017

Hi once more,

While investigating some performance issues I noticed that AuditLogDetails collection is Lazy Loaded. That is fine, however sometimes when I want to iterate over it I end up with multiple queries that loads details one by one. Which is once again completely understandable because of the N+1 problem.

The problem is that I cannot load this collection eagerly. Include(l =l.LogDetails) does not help.

My guess is that after calling GetLogs method from your TrackerContext does something to the api that makes Include misbehave.

So far only workaround I found is to retrieve logs straight from DbContext and then Include works properly but you created GetLogs method probably to avoid retrieving logs like that.

Do you think adding another method like GetLogsEager would be possible in near future?

Regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants