我需要装饰上使用相应的DeadlockRetryCommandHandlerDecorator<T>
型如何使用Castle Windsor注册通用装饰器?
我试过这个解决方案ICommandHandler<T>
所有类型为主,但遗憾的是它不工作。
container.Register(
Component.For(typeof(ICommandHandler<>))
.ImplementedBy(typeof(DeadlockRetryCommandHandlerDecorator<>)));
container.Register(
AllTypes.FromThisAssembly()
.BasedOn(typeof(ICommandHandler<>))
.WithService.Base());
我如何注册一个通用的装饰(DeadlockRetryCommandHandlerDecorator<T>
)来包装所有一般性ICommandHandler<T>
实现?
我该如何实现ISubDependencyResolver? – oguzh4n