public static bool IsNullableType(this Type type) { type.ShouldNotBeNull("type"); return (type.IsGenericType && type.GetGenericTypeDefinition() == typeof(Nullable<>)); }