Comments
3 comments
-
Hi @pascal ,
Thanks for your post!
Would you mind sharing a few screenshots of the differences you're seeing to help us get a better understanding?
I see the Dispose(Boolean) method but it appears to be in Microsoft's source file as well.
Thank you! -
-
Thanks @pascal!
Ah I was seeing the Dispose(boolean) in the ms file and didn't realize it was actually in the SqlDebugContext class.
However, our developers have taken a look into this and the exact same definition ofDispose(Boolean)
shown by .NET Reflector does in fact exist in /System/Data/ProviderBase/DbConnectionHelper.cs.
Technically, it is defined in a classNAMESPACE.CONNECTIONOBJECTNAME
. Our understanding is that it is a kind of a "template" class which later becomesSystem.Data.<span>SqlClient.</span>SqlConnection
(and others).
Though we unfortunately can't find an official source to confirm this, according to someone at Stack Overflow it will be replaced at build time, which explains why it ends up in the final System.Data.dll file.This defines a classCONNECTIONOBJECTNAME
in namespaceNAMESPACE
. Those would be replaced at build-time by the correct class name and namespace name, and this allows multipleDbConnection
-derived classes to share theDispose()
implementation.
(Note that ILDASM shows the Dispose(boolean) method in System.Data.SqlClient.SqlConnection )
Add comment
Please sign in to leave a comment.
I was looking at the System.Data.SqlClient.SqlConnection on .Net 4.8 and finding differences between what reflector shows and what is shown by the Microsoft source files in github (https://github.com/microsoft/referencesource/blob/master/System.Data/fx/src/data/System/Data/SqlClient/SqlConnection.cs or https://referencesource.microsoft.com/#System.Data/fx/src/data/System/Data/SqlClient/SqlConnection.cs,48932d2b804ed473). I was particularly looking at the Dispose() method which reflector shows implementation for it but the MS source file does not show any implementation for it. There are other subtle differences as well which I can't explain.