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

Allow easier injection of customized MySqlRelationalConnection implementations from user code #1863

Conversation

lauxjpn
Copy link
Collaborator

@lauxjpn lauxjpn commented Mar 6, 2024

If users want to replace the default MySqlRelationalConnection instance with with a customized derived one of their own (e.g. by using .ReplaceService<IMySqlRelationalConnection, MyCustomMySqlRelationalConnection>()), they had difficulties returning their customized implementation from the CreateMasterConnection() method.

This PR enables users to override CreateMasterConnectionCore() instead, to allow them to create and return their custom instance in a way that is as simple as possible.

…or user code) by splitting the creation method for admin/master connections.
@lauxjpn lauxjpn added type-enhancement backport-candidate Should be considered for backporting. labels Mar 6, 2024
@lauxjpn lauxjpn added this to the 9.0.0 milestone Mar 6, 2024
@lauxjpn lauxjpn self-assigned this Mar 6, 2024
@lauxjpn lauxjpn changed the title Allow easier injection of a customized MySqlRelationalConnection from user code Allow easier injection of a customized MySqlRelationalConnection implementation from user code Mar 6, 2024
@lauxjpn lauxjpn changed the title Allow easier injection of a customized MySqlRelationalConnection implementation from user code Allow easier injection of customized MySqlRelationalConnection implementations from user code Mar 6, 2024
@lauxjpn lauxjpn merged commit 1ccd763 into PomeloFoundation:main Mar 6, 2024
19 checks passed
@lauxjpn lauxjpn deleted the feature/override_master_connection_creation branch March 6, 2024 16:55
lauxjpn added a commit to lauxjpn/Pomelo.EntityFrameworkCore.MySql that referenced this pull request Mar 15, 2024
…or user code) by splitting the creation method for admin/master connections. (PomeloFoundation#1863)

(cherry picked from commit 1ccd763)
lauxjpn added a commit that referenced this pull request Mar 16, 2024
…ction` implementations from user code (#1883)

Allow easier injection of a customized MySqlRelationalConnection or user code) by splitting the creation method for admin/master connections. (#1863)

(cherry picked from commit 1ccd763)
@lauxjpn lauxjpn modified the milestones: 9.0.0, 9.0.0-preview.2 Mar 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-candidate Should be considered for backporting. type-enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant