Skip to content
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

Closed
divega opened this issue Nov 10, 2015 · 0 comments
Closed

RelationalCommand: stricter separation of construction and execution #3704

divega opened this issue Nov 10, 2015 · 0 comments
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
Copy link
Contributor

divega commented Nov 10, 2015

PR #3690 makes the minimal changes required to enable caching and reuse of RelationalCommand: parameter values can now be passed in each individual Execute 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 the RelationalCommand.

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 the Execute 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.

@divega divega changed the title RelationalCommand: stricter separation of parameter definitions form parameter values RelationalCommand: stricter separation of construction and execution Nov 10, 2015
@rowanmiller rowanmiller added this to the 7.0.0 milestone Nov 13, 2015
@mikary mikary assigned mikary and unassigned divega Feb 5, 2016
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
Fix #3115 - Support passing DbParameter instances to ExecuteSqlCommand
and FromSql
Fix #2315 - Improve FromSql command caching
mikary added a commit that referenced this issue Mar 9, 2016
Fix #3115 - Support passing DbParameter instances to ExecuteSqlCommand
and FromSql
Fix #2315 - Improve FromSql command caching
@mikary mikary closed this as completed in d89beca Mar 11, 2016
@mikary mikary modified the milestones: 1.0.0-rc2, 1.0.0 Mar 11, 2016
@ajcvickers ajcvickers modified the milestones: 1.0.0-rc2, 1.0.0 Oct 15, 2022
@ajcvickers 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
Projects
None yet
Development

No branches or pull requests

4 participants