This repository was archived by the owner on Nov 9, 2022. It is now read-only.
Add wrapper for DbCommand, DbConnection and DbTransaction to support EF#4
Open
CumpsD wants to merge 2 commits intobcuff:masterfrom
CumpsD:feature/ef-implementation
Open
Add wrapper for DbCommand, DbConnection and DbTransaction to support EF#4CumpsD wants to merge 2 commits intobcuff:masterfrom CumpsD:feature/ef-implementation
CumpsD wants to merge 2 commits intobcuff:masterfrom
CumpsD:feature/ef-implementation
Conversation
Open
Collaborator
Author
|
/poke @bcuff any feedback on merging this? |
Owner
|
@CumpsD yeah. it looks good on first glance. I just haven't had the time yet. I'll get back to you soon. Thanks. |
bcuff
suggested changes
May 7, 2018
Owner
bcuff
left a comment
There was a problem hiding this comment.
I'd rather not have separate code paths for TraceDbConnection for entity framework and otherwise. Why not modify the existing TraceDbCommand/Connection to inherit DbConnection instead?
Collaborator
Author
|
I didnt want to introduce breaking changes. People might be using the IDbConnection one. If you dont mind I can replace the existing one with this implementation? Dont forget, for EF I also had to introduce TraceDbTransaction. |
Owner
|
Yes, go ahead and modify the existing one rather than creating new ones. Thanks. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Entity Framework is not able to deal with
IDbCommandandIDbConnection, instead it wants the abstract classDbConnection,DbCommand. Internally it also does a reference compare between the connection and the connection of a transaction, because of this, we also wrap aDbTransactionin aTraceDbTransaction, as a nice side effect, it allows us to add spans for commit and rollback.