Although there is no documentation yet , there is a complete set of unit tests showing all the different ways to customize a decorator template. I believe you want:
For<IProjectService>().DecorateAllWith<ProjectServiceLogDecorator>(); For<IProjectService>().Use<ProjectService>();
You can add additional decorators simply by doing the following. However, note that the external decorator is the last .DecorateAllWith , so it may be more intuitive to specify the innermost class first.
For<IProjectService>().Use<ProjectService>(); For<IProjectService>().DecorateAllWith<ProjectServiceLogDecorator>(); For<IProjectService>().DecorateAllWith<SomeOtherDecorator>();
Result:
SomeOtherDecorator ProjectServiceLogDecorator ProjectService
If you need more control, you can always use smart instances to explicitly apply constructor parameters to the decorator (without having to explicitly specify all parameters).
var projectService = For<IProjectService>().Use<ProjectService>(); For<IProjectService>().Use<ProjectServiceLogDecorator>() .Ctor<IProjectService>().Is(projectService);
source share