I was wondering if there is some way to extend the locations where the DAAB will look for connection strings when resolving a Database dependency?
Specifically, I have DAO objects defined in my unity container, which take a Database as a constructor argument. I can define this param as a dependency either with an attribute like this:
MyDao([Dependency("MyDB")] Database database)
Or in the configuration like this:
<param name="database" type="Database">
<dependency name="MyDB" />
The dependency gets resolved using the connection string in App.config/Web.config with the name "MyDB". However, I am using ExeConfigurationFileMap to load external config files with my unity configurations from separate files. If I still
define the connection string(s) in the main config file, this works fine, but I would like to move them into the mapped files as well, and have them used for dependency resolution. Is there some way to do this without modifying the actual DAAB code which creates
the Database('s) (implement some abstract factory and plug it in, perhaps)?