我需要裝飾上使用相應的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