/// <summary> /// Decorate all registrations to the service type with the supplied decorator type /// </summary> /// <param name="decoratorType"></param> public void DecorateAllWith(Type decoratorType) { var policy = new DecoratorPolicy(_serviceType, decoratorType); _parent.Policies.DecorateWith(policy); }
/// <summary> /// Decorates all instances of T with the concrete type TDecorator /// </summary> /// <typeparam name="TDecorator"></typeparam> public void DecorateAllWith <TDecorator>() where TDecorator : T { var policy = new DecoratorPolicy(typeof(T), typeof(TDecorator)); _parent.AddSingleton <IDecoratorPolicy>(policy); }
/// <summary> /// Decorates all instances of T with the concrete type TDecorator /// </summary> /// <typeparam name="TDecorator"></typeparam> /// <exception cref="NotImplementedException"></exception> public void DecorateAllWith <TDecorator>() where TDecorator : T { var policy = new DecoratorPolicy <T, TDecorator>(); _parent.AddSingleton <IDecoratorPolicy>(policy); }