8
在Simple Injector我可以做到以下几点:简单的喷油器通过硬编码值到构造
container.RegisterSingle<IAuctionContext>(() => new AuctionContext(
new Uri("http://localhost:60001/AuctionDataService.svc/")));
我在做什么这里说,当发现IAuctionContext
,这一新的AuctionContext
更换。问题是,调用RegisterSingle
时,将只使用一个AuctionContext
的实例。我希望它能够通过上述Uri
参数,但没有单个实例但每次都允许一个新实例。
这怎么可能?
我已经编辑你的问题,删除每http://meta.stackexchange.com/questions/2950/should-hi-thanks-taglines-and-salutations-be-removed-from-posts您的签名。请不要使用签名。 =) –
下次我会记住这一点,谢谢。 –