Fix: non primitive out types#340
Merged
smoothdeveloper merged 2 commits intofsprojects:masterfrom May 9, 2019
thinkbeforecoding:fix-non-primitive-out-types
Merged
Fix: non primitive out types#340smoothdeveloper merged 2 commits intofsprojects:masterfrom thinkbeforecoding:fix-non-primitive-out-types
smoothdeveloper merged 2 commits intofsprojects:masterfrom
thinkbeforecoding:fix-non-primitive-out-types
Conversation
Collaborator
|
@thinkbeforecoding thanks for reporting the issue / fix. Could you add a non regression test and a comment around the added check with a bit of context? |
Contributor
Author
|
For the tests, I added a storedproc that pass or not the input Guid to out parameter depending on a bool parameter. |
Contributor
Author
|
Is it ok like this ? |
Contributor
Author
|
No prb, I pushed a version to our local nuget feed. |
smoothdeveloper
added a commit
that referenced
this pull request
May 27, 2019
…ooling for maintenance of this project) * release note / fix for #340 * version number
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 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.
This is a fix for non primitive out types in stored procedures.
I had a case with a output parameter of type Guid, the type provider could not use the Expr.Value(Activator.CreateInstance(…)) since it can do so only for primive types.
In the case of a non primite type, we use Expr.DefaultValue(t) which calls the default ctor.
The change in SetRef<'t> was necessary to set the output value to default<'t> when the parameter value is actually DBNull. This raise the question of actually making it optional…