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

How to it with Multiple Database #2

Open
niteshkatare opened this issue Dec 13, 2022 · 3 comments
Open

How to it with Multiple Database #2

niteshkatare opened this issue Dec 13, 2022 · 3 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@niteshkatare
Copy link

Firstly I would like to thank you for writing such a clean dapper repository pattern, it really made my job easier, the reason I open this issue (not issue actually), I wanted to know is there any way I can use multiple database ? In the example I can see you are using "AddDbConnectionInstantiatorForRepositories" method, I have a use case to use multiple MySqlConnection in the application, any help/suggestions will be appreciated.

@gismofx gismofx added enhancement New feature or request good first issue Good for newcomers labels Dec 13, 2022
@gismofx
Copy link
Owner

gismofx commented Dec 13, 2022

Hi! Thanks!

I have thought about this scenario too. If you have two MySQL connections, for example, both would have the same signature and I'm not sure how dependency injection handles this.. I think you would have an runtime error and might just need to have explicit constructors for dependency injection which would be a pain IMO. I think there is a better solution out there and I'm open to some ideas.. do you have any suggestions?

@niteshkatare
Copy link
Author

Hi,
Thanks for your response, I am looking for the best possible solution, I will do let you know once I come across a better solution to handle it.

@gismofx
Copy link
Owner

gismofx commented Dec 14, 2022

@niteshkatare Can you try this method with this library? I think it will work: https://stackoverflow.com/a/48387767/997088

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants