internal static bool IsOptionalValue(Type type) { if (type.GetTypeInfo().IsGenericType) { if (type.GetGenericTypeDefinition() == typeof(Nullable<>).GetGenericTypeDefinition()) return true; } return false; }