You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there a way to use this to check how many times a dbContext asks the database for data?
In my integration tests I want to assert that the data access method only asks for data once or twice.
I was hoping for a non generic version of the onLoad method?
The text was updated successfully, but these errors were encountered:
Thanks for the prompt reply and excellent library.
However i tried this and it looks like it only tells me how many entities are being tracked by the DB context as the hook is being called for every single entry rather than DB call.
Yes, load hooks are fired for each entity object when created from data in the data source as part of a query or load operation (as it based on ObjectMaterialized event).
If you need to count number of individual queries to database, that is something outside of the scope EntityHooks can help with.
However I recommend looking into EF interceptions. Look at this tutorial for details.
hi,
Is there a way to use this to check how many times a dbContext asks the database for data?
In my integration tests I want to assert that the data access method only asks for data once or twice.
I was hoping for a non generic version of the onLoad method?
The text was updated successfully, but these errors were encountered: