Merged
Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
This PR is less of a merge and more of a total rewrite 😅 . There are a handful of methods that are used in the code to convert between internal representations of a handful of Sql* types (SqlBinary, SqlDecimal, SqlGuid, and SqlMoney). In netcore, we can use built-in methods to get at these internal representations, but netfx will not have access to them. There are equivalent conversion methods available, but they almost always make copies of the data. Thus, we have these methods that directly access the data or internal conversion method for the best performance when reading these types.
The original implementations of these were clunky and confusing, and although it'd be easy to copy-paste them into the common project file, I wanted to make sure we knew what was going on (and whether they were being used). Thus, with a bit of AI magic, I rewrote these conversion methods. Now, I'm sure no one will trust that I did it right - I mean, I don't even trust myself! So, this is my first PR where I'm introducing true unit tests! These were checked against the behavior of the original implementations, so it can be safely assumed that the new implementations do things correctly. I have also added comments to the methods to give a better understanding of how they work, for future people.
Also, say goodbye to dynamic IL method creation!
Issues
#1261
Testing
Added unit tests for the rewritten methods!