private static bool IsNullableGenericType (Type type) { if (!type.IsGenericType) return false; Type genericTypeDefinition = type.GetGenericTypeDefinition(); return genericTypeDefinition == typeof(Nullable<>); } }