Example #1
0
        /// <summary>
        /// Add policies to the <paramref name="policies"/> to configure the container to use the represented
        /// <see cref="Type"/> as an additional interface for the supplied parameters.
        /// </summary>
        /// <param name="serviceType">Interface being registered.</param>
        /// <param name="implementationType">Type to register.</param>
        /// <param name="name">Name used to resolve the type object.</param>
        /// <param name="policies">Policy list to add policies to.</param>
        public override void AddPolicies(Type serviceType, Type implementationType, string name, IPolicyList policies)
        {
            AdditionalInterfacesPolicy policy =
                AdditionalInterfacesPolicy.GetOrCreate(policies, serviceType, name);

            policy.AddAdditionalInterface(_additionalInterface);
        }
        /// <summary>
        /// Add policies to the <paramref name="policies"/> to configure the container to use the represented
        /// <see cref="Type"/> as an additional interface for the supplied parameters.
        /// </summary>
        /// <param name="registeredType">Interface being registered.</param>
        /// <param name="mappedToType">Type to register.</param>
        /// <param name="name">Name used to resolve the type object.</param>
        /// <param name="policies">Policy list to add policies to.</param>
        public override void AddPolicies <TContext, TPolicySet>(Type registeredType, Type mappedToType, string name, ref TPolicySet policies)
        {
            AdditionalInterfacesPolicy policy = AdditionalInterfacesPolicy.GetOrCreate(ref policies);

            policy.AddAdditionalInterface(_additionalInterface);
        }