-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RelationalCommand: stricter separation of construction and execution #3704
Labels
closed-fixed
The issue has been fixed and is/will be included in the release indicated by the issue milestone.
type-cleanup
Milestone
Comments
divega
changed the title
RelationalCommand: stricter separation of parameter definitions form parameter values
RelationalCommand: stricter separation of construction and execution
Nov 10, 2015
mikary
added a commit
that referenced
this issue
Feb 8, 2016
Allow providing parameter values as arguments or cached property value
mikary
added a commit
that referenced
this issue
Feb 16, 2016
Fix #3115 - Support passing DbParameter instances to ExecuteSqlCommand and FromSql
mikary
added a commit
that referenced
this issue
Feb 22, 2016
Fix #3115 - Support passing DbParameter instances to ExecuteSqlCommand and FromSql
mikary
added a commit
that referenced
this issue
Mar 2, 2016
mikary
added a commit
that referenced
this issue
Mar 9, 2016
ajcvickers
added
the
closed-fixed
The issue has been fixed and is/will be included in the release indicated by the issue milestone.
label
Oct 15, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
closed-fixed
The issue has been fixed and is/will be included in the release indicated by the issue milestone.
type-cleanup
PR #3690 makes the minimal changes required to enable caching and reuse of
RelationalCommand
: parameter values can now be passed in each individualExecute
method call in addition to the constructor.The change doesn't preclude the existing pattern from being used though, i.e. you create a RelationalCommand passing both metadata and values for the parameters in the constructor, call one of the
Execute
methods with a null or empty dictionary of parameter values and then discard theRelationalCommand
.Although the option is not exercised in our codebase, it is even possible to use hybrid patterns in which sometimes initial parameter values are used and other times the "fresh" parameter values passed to the various
Execute
methods are used (but from reading the code I think this won't always work as expected because null parameters passed to theExecute
methods are ignored in favor of the corresponding initial values).@anpete and I had a chat about this and we believe there are potential benefits in terms of code cleanliness and efficiency in forcing all usages of
RelationalCommand
to separate the construction of the command's parameters from the binding of parameter values at execution time.The text was updated successfully, but these errors were encountered: