I have 2 database connections on my project. I want to reach them from controllers with constructor.
I have added these to IServiceCollection.
serviceCollection.AddTransient<IDbConnection>(db => new OracleConnection(Configuration.Database1));
serviceCollection.AddTransient<IDbConnection>(db => new OracleConnection(Configuration.Database2));
When I tried to reach one of them, always lastone (Database2) is coming to controller
: Controller
public ExtensionCoreController(IDbConnection connection)
{
}
How can I select one?
Thanks advance.