1
我已經在App主機中註冊了IOC(func)的以下類型。類&下面給出的接口位於單獨的類庫中。此類庫包含WCF服務引用。服務棧如何動態註冊來自不同程序集的類型
private void RegisteTyeps(Container container)
{
//Register Mapper
container.Register<IMapper>(c => _mapperConfiguration.CreateMapper());
container.RegisterAutoWiredAs<AppointmentHandler, IAppointmentHandler>().ReusedWithin(ReuseScope.Container);
container.RegisterAutoWiredAs<CalendarHandler, ICalendarHandler>().ReusedWithin(ReuseScope.Container);
container.RegisterAutoWiredAs<SettingHandler, ISettingHandler>().ReusedWithin(ReuseScope.Container);
}
我想添加一些更多的服務引用(比彼此略有不同),併產生proxies.Thus我加入與相應的服務多一些類庫引用。每個類庫中包含「相同」的界面和CLASSE正如剛纔提到的 。
我想動態加載/切換基於請求頭或類的東西,以便我只能使用具有相應服務參考&代理的特定庫。
我怎樣才能達到這與服務堆棧。任何一個有任何想法?
酷!我沒有考慮工廠,它解決了我的問題。謝謝! – Thabo