In Simple Injector, I can do the following:
container.RegisterSingle<IAuctionContext>(() => new AuctionContext( new Uri("http://localhost:60001/AuctionDataService.svc/")));
What I'm doing here says that when an IAuctionContext found, replace it with the new AuctionContext . The problem is that when calling RegisterSingle , only one instance of AuctionContext will be used. What I would like for it to be able to pass the Uri parameter as above, but not have a single instance, but allow a new instance each time.
How is this possible?
c # dependency-injection ioc-container simple-injector
Sachin kainth
source share