Exemple #1
0
        public Type GetUnderlyingType()
        {
            var assembly = AppDomain.CurrentDomain.GetAssemblies().FirstOrDefault(x => x.GetName().Name == Assembly)
                           ?? ImplementationsProvider.Instance.GetAssemblies().FirstOrDefault(x => x.GetName().Name == Assembly);

            if (assembly == null)
            {
                return(null);
            }

            Type t = assembly.GetType(FullName);

            if (t != null && t.IsGenericType)
            {
                return(t.MakeGenericType(GenericTypeArgs.Select(x => x.GetUnderlyingType()).ToArray()));
            }

            return(t);
        }
Exemple #2
0
 public override string ToString() => IsGenericType
     ? $"{Name.Split('`').FirstOrDefault()}<{string.Join(",", GenericTypeArgs.Select(x => x.Name))}>"
     : Name;