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

Add ConnectionCreating/ConnectionCreated to DbConnectionInterceptor #23087

Closed
3GDXC opened this issue Oct 24, 2020 · 5 comments · Fixed by #27920
Closed

Add ConnectionCreating/ConnectionCreated to DbConnectionInterceptor #23087

3GDXC opened this issue Oct 24, 2020 · 5 comments · Fixed by #27920
Labels
area-interception closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. customer-reported type-enhancement
Milestone

Comments

@3GDXC
Copy link

3GDXC commented Oct 24, 2020

I would like to make use and custom key value pairs on the ConnectionString to configure the mode of operation for the interceptors.

Adding the ConnectionCreating/ConnectionCreated would align with Command Interceptor and allow the developer to override the validation of the ConnectionString etc. internal to the provider to config the interceptors operations/mode

@roji
Copy link
Member

roji commented Oct 25, 2020

@3GDXC any reason why you can't just use ConnectionOpening for that?

@3GDXC
Copy link
Author

3GDXC commented Oct 25, 2020

@roji using opening connection looks to happen after the call where the connection string is evaluated/validated and therefore any extra key/value pairs added for configuration of interceptor are causing exceptions; allowing a creating before actually creating the connection object would prevent this and allow interceptors to remove additional key/value pairs from the connection string.

@roji
Copy link
Member

roji commented Oct 25, 2020

Is this a duplicate of #23085? See my code sample there.

@ajcvickers ajcvickers added this to the Backlog milestone Oct 27, 2020
@ajcvickers ajcvickers modified the milestones: Backlog, 7.0.0 Apr 30, 2022
@ajcvickers ajcvickers self-assigned this Apr 30, 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 Apr 30, 2022
ajcvickers added a commit that referenced this issue Apr 30, 2022
ajcvickers added a commit that referenced this issue May 4, 2022
@ajcvickers ajcvickers modified the milestones: 7.0.0, 7.0.0-preview5 May 4, 2022
@ajcvickers ajcvickers changed the title Please consider adding two methods to the DbConnectionInterceptor Creating/Created Add ConnectionCreating/ConnectionCreated to DbConnectionInterceptor Jun 23, 2022
@frandazzo
Copy link

Hi, i just tried to nuget the DbConnectionInterceptor (version 7) and tried to override the ConnectionCreating method that was not found.
It's a very important feature because in this way i can override the way a connection is created (with a custom conneciton factory for example). Any idea?

@ajcvickers
Copy link
Member

@frandazzo Please open a new issue and attach a small, runnable project or post a small, runnable code listing that reproduces what you are seeing so that we can investigate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-interception closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. customer-reported type-enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants