<PackageReference Include="System.Text.Json" Version="6.0.9" />

ReflectionExtensions

static class ReflectionExtensions
public const string CreateRangeMethodName = "CreateRange"

public static bool CanBeNull(this Type type)

Returns true when the given type is either a reference type or of type Nullable<T>.

public static Type GetCompatibleGenericBaseClass(this Type type, Type baseType, Type objectType = null, bool sourceGenType = false)

public static Type GetCompatibleGenericInterface(this Type type, Type interfaceType)

public static object GetDefaultValue(this ParameterInfo parameterInfo)

public static string GetImmutableDictionaryConstructingTypeName(this Type type, bool sourceGenType = false)

public static string GetImmutableEnumerableConstructingTypeName(this Type type, bool sourceGenType = false)

public static bool IsAssignableFromInternal(this Type type, Type from)

Returns true when the given type is assignable from from including support when from is Nullable<T> by using the {T} generic parameter for from.

public static bool IsImmutableDictionaryType(this Type type, bool sourceGenType = false)

public static bool IsImmutableEnumerableType(this Type type, bool sourceGenType = false)

public static bool IsKeyValuePair(this Type type, Type keyValuePairType = null)

public static bool IsNullableOfT(this Type type)

Returns true when the given type is of type Nullable<T>.

public static bool IsVirtual(this PropertyInfo propertyInfo)

public static bool TryGetDeserializationConstructor(this Type type, bool useDefaultCtorInAnnotatedStructs, out ConstructorInfo deserializationCtor)