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
Integration with MiniProfiler #44
I'm interested in using stackoverflow's MiniProfiler and got it working by modifying two lines, but I wondered if there was a way to do it without changing PetaPoco.cs.
First when creating a command (CreateCommand method), PetaPoco uses _factory if present, otherwise uses connection.CreateCommand. Is there a reason not to use connection.CreateCommand all the time? This is one of the changes I needed to make to get MiniProfiler to work.
The second change was adding this line to OpenSharedConnection:
If PetaPoco had a method for modifying connections it wouldn't have to reference the new assembly. This doesn't seem the best way though... One for Command might be nice to to enable things like global CommandTimeout changes because I don't like the default timeout, but that might be a setting I could add to the database object...
Declaration in PetaPoco.Database:
And in OpenSharedConnection:
And in Application_Start:
Since PetaPoco is a single file it might just be better to modify it specifically for this task... Thoughts?
I've made some changes that should facilitate this.
Please let me know if this works.