Data store command interception
See original GitHub issueIs there any extensible point on where EF hits the db, something that can be overridable to log or do anything everytime a hit to the db.
im wondering of something like
override OnDatabaseHit(Operation op, Context context) {
if (typeof(op) == Query | SaveChanges | ... {
Console.WriteLine(context.Query)
}
}
if not, take it as a suggestion for EF7 😃
Issue Analytics
- State:
- Created 9 years ago
- Comments:10 (4 by maintainers)
Top Results From Across the Web
ArcGIS Data Store command utility reference—ArcGIS ...
This utility is used with relational, tile cache, and spatiotemporal big data stores and graph stores. If you need to create a relational...
Read more >Entity Framework 6, Command Interception & Stored ...
You can always use Context Log property for intercepting any of the DB queries fires using DataContext. You can define a constructor on...
Read more >SYSMSGS Command: Intercept Messages - TechDocs
The SYSMSGS command intercepts any message while it is being written to the JES system message data set belonging to an individual JOB...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi there What about Intercepting connection level to support Row Level Security. I checked the latest release, but still not supported yet. I’m working around this lack by connecting the legacy handler
Database.GetDbConnection().StateChange
to monitor the connection state in order to inject my session context:on a derived DbContext constructor.
I would like to see a better approach using DI to pipe this injection? Thanks
I put a question on stack-overflow to seek alternative techniques for EF Core.
http://stackoverflow.com/questions/37660746/can-i-configure-an-interceptor-yet-in-entityframework-core
Instead of a heavyweight framework approach perhaps whatever replaces interceptors could be a very lightweight and simple pattern.