Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
New approach to profile EF6, using an Interceptor #44
@fujiy thanks for the PR.
Can you please make a case why this approach is better than the existing approach used in this project? What does it add (feature/performance/maintainability/usability) that we don't have already?
Also, while the current approach wraps all of the EF commands as
The main reason I did it is because its conflicting with other libraries that also wraps DbProviderServices, like EFProf: http://community.miniprofiler.com/t/miniprofiler-efprof-doesnt-work/239
MiniProfiler was assuming that DbProviderServices should have a Instance property.
I see this approach as a Hack, what is explainable, since was the only way to do it. (EFProf also do it)
But now, EF Interceptors came to solve this problem.
Answering your question:
1-) I think this new approach is just more maintainability and correct, but I didn't any enhancement but Parameters Info (http://blog.fujiy.net/Upload/Post10210/example.png)
2-) I never read MiniProfiler code until now, So maybe I didn't take the best approach, but using Interceptor doesn't seem make sense to use ProfiledCommand.
I hear what you are saying about using an "explainable hack", and the benefits of getting away from it.
However, I don't think that we would consider doing that unless we were still treating Sql Commands (since that is what EF is producing) as
So I don't know if it is really worth it, especially considering that the current method does work for almost every case, and this initialization method is only causing issue when MiniProfiler is being used with a different EF profiler at the same time (something that we would be happy to avoid if easily possible, but is also not a scenario that will come up so often).
@dixon your thoughts?
@fujiy I appreciate your approach. However, as the current method we are using for EF works for all scenarios other than a conflict with a different profiler, and also supports add ons like spatial support, I don't see us moving forward rewriting the logic for this at the current time.