Exemplo n.º 1
0
            /// <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);
            }
Exemplo n.º 2
0
            /// <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);
            }
Exemplo n.º 3
0
            /// <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);
            }