lookbrazerzkidai.blogg.se

Multiple idatabase instances windsor registration
Multiple idatabase instances windsor registration







multiple idatabase instances windsor registration

DependsOn(Dependency.OnComponent(typeof (DbContext), "datactx"))) '' is waiting for the following dependencies:īut I have installed AccountsContext in facility logic.Īccording to suggestion I have tweaked my facility this way: public class PersistenceFacility : AbstractFacilityĪnd also repositories installler: public class RepositoriesInstaller : IWindsorInstaller Service '' which was not registered.Ĭ: Can't create component '' as it has dependencies to be satisfied. '' is waiting for the following dependencies: Public HomeController(IEntityRepository accs, IEntityRepository data)Īlso I have changed installer code: container.Register(Īnd now during controller resolving proccess return (IController) kernel.Resolve(controllerType) Ĭan't create component '' as it has dependencies to be satisfied. So after cosmetic interfaces changes my contreller become: public class HomeController : Controller Public virtual void ExecuteProcedure(String procedureCommand, params SqlParameter sqlParams)Ĭ(procedureCommand, sqlParams) ĭataRepository looks the same way, my be at some point I will decide to have just one concrete class EntityRepository, but it not relevant to exceptions I receiving. Public AccountsRepository(AccountsContext c)

multiple idatabase instances windsor registration

Public class AccountsRepository : IEntityRepository Public interface IEntityRepository : IRepository Void ExecuteProcedure(String procedureCommand, params SqlParameter sqlParams) Please, explain me proper way to deal with this kind of injection.Īs suggested I have implemented generic repositories: public interface IRepository : IDisposable Of course I wanna see "data" being DataRepository respectively. So when I'm using my controller both parameters are injected with AccountsRepository instance (which was registered first).

multiple idatabase instances windsor registration

and installed: public class PersistenceInstaller : IWindsorInstaller Public void Install(IWindsorContainer container, IConfigurationStore store)Īlso I have facilities setted up: public class PersistenceFacility : AbstractFacility Public M圜ontroller(IEntityRepository accs, IEntityRepository data)Īnd I installed container this way: public class RepositoriesInstaller : IWindsorInstaller I have my controller like this public class M圜ontroller : Controller









Multiple idatabase instances windsor registration