Example #1
0
        public static Type ReflectGenTypeArgument(this IGen gen)
        {
            var reflectedGenType = gen
                                   .GetType()
                                   .GetInterfaces()
                                   .Where(x => x.IsGenericType && x.GetGenericTypeDefinition() == typeof(IGen <>))
                                   .SingleOrDefault();

            return(reflectedGenType.GetGenericArguments().Single());
        }