public static IRegistrationBuilder <object, OpenGenericDecoratorActivatorData, DynamicRegistrationStyle> RegisterGenericDecorator(this ContainerBuilder builder, Type decoratorType, Type decoratedServiceType, object fromKey, object toKey)
 {
     if (builder == null)
     {
         throw new ArgumentNullException("builder");
     }
     if (decoratorType == null)
     {
         throw new ArgumentNullException("decoratorType");
     }
     if (decoratedServiceType == null)
     {
         throw new ArgumentNullException("decoratedServiceType");
     }
     return(OpenGenericRegistrationExtensions.RegisterGenericDecorator(builder, decoratorType, decoratedServiceType, fromKey, toKey));
 }
Beispiel #2
0
        RegisterGenericDecorator(
            this ContainerBuilder builder,
            Type decoratorType,
            Type decoratedServiceType,
            object fromKey,
            object?toKey = null)
        {
            if (builder == null)
            {
                throw new ArgumentNullException(nameof(builder));
            }

            if (decoratorType == null)
            {
                throw new ArgumentNullException(nameof(decoratorType));
            }

            if (decoratedServiceType == null)
            {
                throw new ArgumentNullException(nameof(decoratedServiceType));
            }

            return(OpenGenericRegistrationExtensions.RegisterGenericDecorator(builder, decoratorType, decoratedServiceType, fromKey, toKey));
        }
        RegisterGenericDecorator(
            this ContainerBuilder builder,
            [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type decoratorType,
            Type decoratedServiceType,
            object fromKey,
            object?toKey = null)
        {
            if (builder == null)
            {
                throw new ArgumentNullException(nameof(builder));
            }

            if (decoratorType == null)
            {
                throw new ArgumentNullException(nameof(decoratorType));
            }

            if (decoratedServiceType == null)
            {
                throw new ArgumentNullException(nameof(decoratedServiceType));
            }

            return(OpenGenericRegistrationExtensions.RegisterGenericDecorator(builder, decoratorType, decoratedServiceType, fromKey, toKey));
        }