DI for repository while using multiple databases
In an application which uses multiple databases, should I create DBContext object for each database and inject all of them to the repository or should I create a generic DB Context and create repository object based on the database I want to use in different functions?
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.

jaiganesh paramanantham131 reputationPosted Jan 27, 2015, 1:04 AM EST
string GetConnection()
}
Class OracleConnection : IDBcontext {
public string GetConnection(){
return "Oracle Connection":
}
}
Class SQLConnection : IDBcontext {
public string GetConnection(){
return " SQL Connection":
}
}
class main(){
IDBcontext _DBcontext;
_DBcontext = new SQLConnection();
_DBcontext = new OracleConnection ();
}