I want to redefine an (default) implementation in a given windsor-container. Is that what OverWrite is for? Doesn't work, though.
container.Register(
Component.For<IServiceOperationAuthorization>()
.OverWrite()
.Instance(_authorization)
);
Any other Ideas?
cheers, Lars
You could very simply do this in the place you need to override the default implementation. This is an example from our integration tests. Both implementations are now registered but your code will use the default one, which is the one you've just registered. Works like a bomb and doesn't have any impact on the rest of the application:
var sendMailStub = MockRepository.GenerateStub<ISendMail>();
_container.Register(
Component
.For<ISendMail>()
.Instance(sendMailStub)
.IsDefault()
);