Exemple #1
0
        /// <summary>
        /// Gets the export types.
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <returns>IEnumerable{Type}.</returns>
        public IEnumerable <Type> GetExportTypes <T>()
        {
            var currentType = typeof(T);

#if NET46
            return(AllConcreteTypes.Where(currentType.IsAssignableFrom));
#elif NETSTANDARD1_6
            var currentTypeInfo = currentType.GetTypeInfo();

            return(AllConcreteTypes.Where(currentTypeInfo.IsAssignableFrom));
#endif
            return(new List <Type>());
        }
        /// <summary>
        /// Gets the export types.
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <returns>IEnumerable{Type}.</returns>
        public IEnumerable <Type> GetExportTypes <T>()
        {
            var currentType = typeof(T);

            return(AllConcreteTypes.Where(currentType.IsAssignableFrom));
        }