Пример #1
0
        internal static void ImplementationHasSelectableConstructor(Container container, Type serviceType,
                                                                    Type implementationType, string paramName)
        {
            string message;

            if (!container.IsConstructableType(serviceType, implementationType, out message))
            {
                throw new ArgumentException(message, paramName);
            }
        }
Пример #2
0
        internal static void ImplementationsAllHaveSelectableConstructor(Container container,
                                                                         Type openGenericServiceType, IEnumerable <Type> openGenericImplementations, string paramName)
        {
            foreach (Type type in openGenericImplementations)
            {
                string message = null;

                if (!container.IsConstructableType(openGenericServiceType, type, out message))
                {
                    throw new ArgumentException(message, paramName);
                }
            }
        }