Closed jquintero33 closed 5 years ago
@jquintero33 the MySql Connector does not currently support binding more than one database. Could you provide a little more context around how you would like that functionality to work?
Re-reading my original answer, I should note that it was not technically correct. Steeltoe connectors have always supported binding more than one instance of any given service, you just have to use the methods that specify the binding name when you add them to the DI container.
The real problem has been getting them back out of the container.. this is not a complete solution, but the MySQL EFCore sample has been updated to work with multiple databases. This type of example would work with any of the EntityFramework variants since we can request which DbContext we want.
It is worth noting that this is a limitation of the way Microsoft Dependency Injection works -- by that I'm referring to the inability to qualify which instance of type X you're requesting:
// eg: How do I specify WHICH MySqlConnection I want here?
public IActionResult MySqlData([FromServices] MySqlConnection dbConnection)
Closing issue. Please reopen under the steeltoe
repository if still an issue.
Does the MySqlConnector support binding to more than one database?