Catnap.Extensions.TypeExtensions.GetUnderlyingGenericType C# (CSharp) Метод

GetUnderlyingGenericType() публичный статический Метод

public static GetUnderlyingGenericType ( this type ) : Type
type this
Результат System.Type
        public static Type GetUnderlyingGenericType(this Type type)
        {
            if (!type.IsGenericType)
            {
                return type;
            }
            var genericType = type.GetGenericTypeDefinition();
            return genericType.Equals(typeof(Nullable<>))
                ? type.GetGenericArguments()[0]
                : type;
        }